This repository has been archived on 2025-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2025-02-21/src/helper_inbox.py

23 lines
691 B
Python
Raw Normal View History

2018-04-07 16:11:24 +05:30
"""Helper Inbox performs inbox messagese related operations."""
from helper_sql import sqlExecute, sqlQuery
import queues
2018-04-07 16:11:24 +05:30
def insert(t):
sqlExecute('''INSERT INTO inbox VALUES (?,?,?,?,?,?,?,?,?,?)''', *t)
2018-04-07 16:11:24 +05:30
# shouldn't emit changedInboxUnread and displayNewInboxMessage
# at the same time
# queues.UISignalQueue.put(('changedInboxUnread', None))
def trash(msgid):
2013-08-27 08:13:40 -04:00
sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', msgid)
2018-04-07 16:11:24 +05:30
queues.UISignalQueue.put(('removeInboxRowByMsgid', msgid))
def isMessageAlreadyInInbox(sigHash):
2014-07-26 13:15:28 -04:00
queryReturn = sqlQuery(
'''SELECT COUNT(*) FROM inbox WHERE sighash=?''', sigHash)
return queryReturn[0][0] != 0