Added helper_db.put_trash and replaced helper_inbox in api
This commit is contained in:
parent
9367948387
commit
1364116304
|
@ -74,7 +74,6 @@ from struct import pack
|
||||||
|
|
||||||
import defaults
|
import defaults
|
||||||
import helper_db
|
import helper_db
|
||||||
import helper_inbox
|
|
||||||
import network.stats
|
import network.stats
|
||||||
import proofofwork
|
import proofofwork
|
||||||
import queues
|
import queues
|
||||||
|
@ -1051,23 +1050,23 @@ class BMRPCDispatcher(object):
|
||||||
"""
|
"""
|
||||||
msgid = self._decode(msgid, "hex")
|
msgid = self._decode(msgid, "hex")
|
||||||
# Trash if in inbox table
|
# Trash if in inbox table
|
||||||
helper_inbox.trash(msgid)
|
helper_db.put_trash(msgid)
|
||||||
# Trash if in sent table
|
# Trash if in sent table
|
||||||
sqlExecute("UPDATE sent SET folder='trash' WHERE msgid=?", msgid)
|
helper_db.put_trash(msgid, sent=True)
|
||||||
return 'Trashed message (assuming message existed).'
|
return 'Trashed message (assuming message existed).'
|
||||||
|
|
||||||
@command('trashInboxMessage')
|
@command('trashInboxMessage')
|
||||||
def HandleTrashInboxMessage(self, msgid):
|
def HandleTrashInboxMessage(self, msgid):
|
||||||
"""Trash inbox message by msgid (encoded in hex)."""
|
"""Trash inbox message by msgid (encoded in hex)."""
|
||||||
msgid = self._decode(msgid, "hex")
|
msgid = self._decode(msgid, "hex")
|
||||||
helper_inbox.trash(msgid)
|
helper_db.put_trash(msgid)
|
||||||
return 'Trashed inbox message (assuming message existed).'
|
return 'Trashed inbox message (assuming message existed).'
|
||||||
|
|
||||||
@command('trashSentMessage')
|
@command('trashSentMessage')
|
||||||
def HandleTrashSentMessage(self, msgid):
|
def HandleTrashSentMessage(self, msgid):
|
||||||
"""Trash sent message by msgid (encoded in hex)."""
|
"""Trash sent message by msgid (encoded in hex)."""
|
||||||
msgid = self._decode(msgid, "hex")
|
msgid = self._decode(msgid, "hex")
|
||||||
sqlExecute('''UPDATE sent SET folder='trash' WHERE msgid=?''', msgid)
|
helper_db.put_trash(msgid, sent=True)
|
||||||
return 'Trashed sent message (assuming message existed).'
|
return 'Trashed sent message (assuming message existed).'
|
||||||
|
|
||||||
@command('sendMessage')
|
@command('sendMessage')
|
||||||
|
|
|
@ -74,6 +74,15 @@ def put_inbox(
|
||||||
"newBroadcast" if broadcast else "newMessage"])
|
"newBroadcast" if broadcast else "newMessage"])
|
||||||
|
|
||||||
|
|
||||||
|
def put_trash(msgid, sent=False):
|
||||||
|
"""Put inbox message (or sent if sent=True) into trash by msgid"""
|
||||||
|
sqlExecute(
|
||||||
|
"UPDATE %s SET folder='trash' WHERE msgid=?" %
|
||||||
|
('sent' if sent else 'inbox'), msgid)
|
||||||
|
if not sent:
|
||||||
|
queues.UISignalQueue.put(('removeInboxRowByMsgid', msgid))
|
||||||
|
|
||||||
|
|
||||||
def put_pubkey(address, address_version, data, used_personally=None):
|
def put_pubkey(address, address_version, data, used_personally=None):
|
||||||
"""Put pubkey into Pubkeys table"""
|
"""Put pubkey into Pubkeys table"""
|
||||||
if used_personally is None:
|
if used_personally is None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user