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

23 lines
646 B
Python

import shared
def insert(t):
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put(
'''INSERT INTO inbox VALUES (?,?,?,?,?,?,?,?,?)''')
shared.sqlSubmitQueue.put(t)
shared.sqlReturnQueue.get()
shared.sqlSubmitQueue.put('commit')
shared.sqlLock.release()
def trash(msgid):
t = (msgid,)
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put(
'''UPDATE inbox SET folder='trash' WHERE msgid=?''')
shared.sqlSubmitQueue.put(t)
shared.sqlReturnQueue.get()
shared.sqlSubmitQueue.put('commit')
shared.sqlLock.release()
shared.UISignalQueue.put(('removeInboxRowByMsgid',msgid))