PyBitmessage-2021-04-27/src/helper_inbox.py
mailchuck eb98192a0c
Update unread count more efficiently
Fixes #63. There are still some situations which can be improved but it
appears good enough.
2015-10-31 15:27:16 +01:00

16 lines
602 B
Python

from helper_sql import *
import shared
def insert(t):
sqlExecute('''INSERT INTO inbox VALUES (?,?,?,?,?,?,?,?,?,?)''', *t)
#shouldn't emit changedInboxUnread and displayNewInboxMessage at the same time
#shared.UISignalQueue.put(('changedInboxUnread', None))
def trash(msgid):
sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', msgid)
shared.UISignalQueue.put(('removeInboxRowByMsgid',msgid))
def isMessageAlreadyInInbox(sigHash):
queryReturn = sqlQuery(
'''SELECT COUNT(*) FROM inbox WHERE sighash=?''', sigHash)
return queryReturn[0][0] != 0