From b5f42d75496f9119070fe679fb096ddb20b374df Mon Sep 17 00:00:00 2001 From: Joshua Noble Date: Mon, 26 Aug 2013 22:29:57 -0400 Subject: [PATCH] Added trashSentMessageByAckData API command --- src/bitmessagemain.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 721b6a8d..e18a15d3 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -507,6 +507,19 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): shared.sqlLock.release() # shared.UISignalQueue.put(('removeSentRowByMsgid',msgid)) This function doesn't exist yet. return 'Trashed sent message (assuming message existed).' + elif method == 'trashSentMessageByAckData': + # This API method should only be used when msgid is not available + if len(params) == 0: + raise APIError(0, 'I need parameters!') + ackdata = self._decode(params[0], "hex") + t = (ackdata,) + shared.sqlLock.acquire() + shared.sqlSubmitQueue.put('''UPDATE sent SET folder='trash' WHERE ackdata=?''') + shared.sqlSubmitQueue.put(t) + shared.sqlReturnQueue.get() + shared.sqlSubmitQueue.put('commit') + shared.sqlLock.release() + return 'Trashed sent message (assuming message existed).' elif method == 'sendMessage': if len(params) == 0: raise APIError(0, 'I need parameters!')