PyBitmessage/src/helper_inbox.py

15 lines
518 B
Python
Raw Normal View History

2013-08-27 14:13:40 +02:00
from helper_sql import *
import shared
def insert(t):
sqlExecute('''INSERT INTO inbox VALUES (?,?,?,?,?,?,?,?,?,?)''', *t)
shared.UISignalQueue.put(('changedInboxUnread', None))
def trash(msgid):
2013-08-27 14:13:40 +02:00
sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', msgid)
shared.UISignalQueue.put(('removeInboxRowByMsgid',msgid))
def isMessageAlreadyInInbox(sigHash):
2014-07-26 19:15:28 +02:00
queryReturn = sqlQuery(
'''SELECT COUNT(*) FROM inbox WHERE sighash=?''', sigHash)
2014-07-26 19:15:28 +02:00
return queryReturn[0][0] != 0