2013-08-27 14:13:40 +02:00
|
|
|
from helper_sql import *
|
2013-09-03 21:56:07 +02:00
|
|
|
import shared
|
2013-06-21 01:25:01 +02:00
|
|
|
|
|
|
|
def insert(t):
|
2015-02-21 03:03:20 +01:00
|
|
|
sqlExecute('''INSERT INTO inbox VALUES (?,?,?,?,?,?,?,?,?,?)''', *t)
|
2015-10-31 15:27:07 +01:00
|
|
|
#shouldn't emit changedInboxUnread and displayNewInboxMessage at the same time
|
|
|
|
#shared.UISignalQueue.put(('changedInboxUnread', None))
|
2013-06-21 01:25:01 +02:00
|
|
|
|
|
|
|
def trash(msgid):
|
2013-08-27 14:13:40 +02:00
|
|
|
sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', msgid)
|
2013-06-21 01:25:01 +02:00
|
|
|
shared.UISignalQueue.put(('removeInboxRowByMsgid',msgid))
|
|
|
|
|
2015-02-21 03:03:20 +01:00
|
|
|
def isMessageAlreadyInInbox(sigHash):
|
2014-07-26 19:15:28 +02:00
|
|
|
queryReturn = sqlQuery(
|
2015-02-21 03:03:20 +01:00
|
|
|
'''SELECT COUNT(*) FROM inbox WHERE sighash=?''', sigHash)
|
2014-07-26 19:15:28 +02:00
|
|
|
return queryReturn[0][0] != 0
|