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

15 lines
672 B
Python
Raw Normal View History

2013-08-27 14:13:40 +02:00
from helper_sql import *
import shared
def insert(t):
2013-08-27 14:13:40 +02:00
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))
2014-07-26 19:15:28 +02:00
def isMessageAlreadyInInbox(toAddress, fromAddress, subject, body, encodingType):
queryReturn = sqlQuery(
'''SELECT COUNT(*) FROM inbox WHERE toaddress=? AND fromaddress=? AND subject=? AND message=? AND encodingtype=? ''', toAddress, fromAddress, subject, body, encodingType)
return queryReturn[0][0] != 0