fixes to new SQL refactoring
This commit is contained in:
parent
ea3cf9e00e
commit
f64461feb0
|
@ -441,8 +441,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
# Trash if in inbox table
|
# Trash if in inbox table
|
||||||
helper_inbox.trash(msgid)
|
helper_inbox.trash(msgid)
|
||||||
# Trash if in sent table
|
# Trash if in sent table
|
||||||
t = (msgid,)
|
sqlExecute('''UPDATE sent SET folder='trash' WHERE msgid=?''', msgid)
|
||||||
sqlExecute('''UPDATE sent SET folder='trash' WHERE msgid=?''', t)
|
|
||||||
return 'Trashed message (assuming message existed).'
|
return 'Trashed message (assuming message existed).'
|
||||||
elif method == 'trashInboxMessage':
|
elif method == 'trashInboxMessage':
|
||||||
if len(params) == 0:
|
if len(params) == 0:
|
||||||
|
@ -454,8 +453,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
if len(params) == 0:
|
if len(params) == 0:
|
||||||
raise APIError(0, 'I need parameters!')
|
raise APIError(0, 'I need parameters!')
|
||||||
msgid = self._decode(params[0], "hex")
|
msgid = self._decode(params[0], "hex")
|
||||||
t = (msgid,)
|
sqlExecute('''UPDATE sent SET folder='trash' WHERE msgid=?''', msgid)
|
||||||
sqlExecute('''UPDATE sent SET folder='trash' WHERE msgid=?''', t)
|
|
||||||
return 'Trashed sent message (assuming message existed).'
|
return 'Trashed sent message (assuming message existed).'
|
||||||
elif method == 'trashSentMessageByAckData':
|
elif method == 'trashSentMessageByAckData':
|
||||||
# This API method should only be used when msgid is not available
|
# This API method should only be used when msgid is not available
|
||||||
|
@ -735,7 +733,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
readPosition = 16 # Nonce length + time length
|
readPosition = 16 # Nonce length + time length
|
||||||
readPosition += decodeVarint(payload[readPosition:readPosition+10])[1] # Stream Number length
|
readPosition += decodeVarint(payload[readPosition:readPosition+10])[1] # Stream Number length
|
||||||
t = (payload[readPosition:readPosition+20],hash)
|
t = (payload[readPosition:readPosition+20],hash)
|
||||||
sql.execute('''UPDATE inventory SET first20bytesofencryptedmessage=? WHERE hash=?; ''', t)
|
sql.execute('''UPDATE inventory SET first20bytesofencryptedmessage=? WHERE hash=?; ''', *t)
|
||||||
|
|
||||||
queryreturn = sqlQuery('''SELECT payload FROM inventory WHERE first20bytesofencryptedmessage = ?''',
|
queryreturn = sqlQuery('''SELECT payload FROM inventory WHERE first20bytesofencryptedmessage = ?''',
|
||||||
requestedHash)
|
requestedHash)
|
||||||
|
|
|
@ -1606,7 +1606,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
t = ('', toAddress, ripe, fromAddress, subject, message, ackdata, int(
|
t = ('', toAddress, ripe, fromAddress, subject, message, ackdata, int(
|
||||||
time.time()), 'broadcastqueued', 1, 1, 'sent', 2)
|
time.time()), 'broadcastqueued', 1, 1, 'sent', 2)
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
'''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)''', t)
|
'''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)''', *t)
|
||||||
|
|
||||||
shared.workerQueue.put(('sendbroadcast', ''))
|
shared.workerQueue.put(('sendbroadcast', ''))
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ sqlLock = threading.Lock()
|
||||||
|
|
||||||
def sqlQuery(sqlStatement, *args):
|
def sqlQuery(sqlStatement, *args):
|
||||||
sqlLock.acquire()
|
sqlLock.acquire()
|
||||||
print 'sqlQuery args are:', args
|
|
||||||
sqlSubmitQueue.put(sqlStatement)
|
sqlSubmitQueue.put(sqlStatement)
|
||||||
|
|
||||||
if args == ():
|
if args == ():
|
||||||
|
@ -22,7 +21,6 @@ def sqlQuery(sqlStatement, *args):
|
||||||
|
|
||||||
def sqlExecute(sqlStatement, *args):
|
def sqlExecute(sqlStatement, *args):
|
||||||
sqlLock.acquire()
|
sqlLock.acquire()
|
||||||
print 'sqlExecute args are:', args
|
|
||||||
sqlSubmitQueue.put(sqlStatement)
|
sqlSubmitQueue.put(sqlStatement)
|
||||||
|
|
||||||
if args == ():
|
if args == ():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user