From 7f272e8ababf3c5663185593500162901e248678 Mon Sep 17 00:00:00 2001 From: Navjot Date: Fri, 16 Aug 2019 20:26:19 +0530 Subject: [PATCH] wokred on updating database query of sent table --- src/bitmessagekivy/mpybit.py | 10 +++++----- src/class_singleCleaner.py | 2 +- src/class_singleWorker.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index 0318a6cc..c7c5d266 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -1546,14 +1546,14 @@ class Draft(Screen): def delete_draft(self, data_index, instance, *args): """Method used to delete draft message permanently.""" - sqlExecute( - "UPDATE sent SET folder = 'draft, trash' WHERE lastactiontime = {};".format( - data_index)) + # sqlExecute( + # "UPDATE sent SET folder = 'draft, trash' WHERE lastactiontime = {};".format( + # data_index)) # sqlExecute( # "UPDATE sent SET folder = 'trash' WHERE lastactiontime = {};".format( # data_index)) - # sqlExecute("DELETE FROM sent WHERE lastactiontime = '{}';".format( - # data_index)) + sqlExecute("DELETE FROM sent WHERE lastactiontime = '{}';".format( + data_index)) try: msg_count_objs = \ self.parent.parent.parent.parent.children[2].children[0].ids diff --git a/src/class_singleCleaner.py b/src/class_singleCleaner.py index e2cdbb89..2e9d1c3f 100644 --- a/src/class_singleCleaner.py +++ b/src/class_singleCleaner.py @@ -96,7 +96,7 @@ class singleCleaner(threading.Thread, StoppableThread): queryreturn = sqlQuery( "SELECT toaddress, ackdata, status FROM sent" " WHERE ((status='awaitingpubkey' OR status='msgsent')" - " AND folder='sent' AND sleeptill?)", + " AND folder LIKE '%sent%' AND sleeptill?)", int(time.time()), int(time.time()) - shared.maximumLengthOfTimeToBotherResendingMessages ) diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index 55ecc63a..6ed7c32e 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -73,7 +73,7 @@ class singleWorker(threading.Thread, StoppableThread): # Initialize the neededPubkeys dictionary. queryreturn = sqlQuery( '''SELECT DISTINCT toaddress FROM sent''' - ''' WHERE (status='awaitingpubkey' AND folder='sent')''') + ''' WHERE (status='awaitingpubkey' AND folder LIKE '%sent%')''') for row in queryreturn: toAddress, = row # toStatus @@ -516,7 +516,7 @@ class singleWorker(threading.Thread, StoppableThread): queryreturn = sqlQuery( '''SELECT fromaddress, subject, message, ''' ''' ackdata, ttl, encodingtype FROM sent ''' - ''' WHERE status=? and folder='sent' ''', 'broadcastqueued') + ''' WHERE status=? and folder LIKE '%sent%' ''', 'broadcastqueued') for row in queryreturn: fromaddress, subject, body, ackdata, TTL, encoding = row @@ -686,7 +686,7 @@ class singleWorker(threading.Thread, StoppableThread): '''SELECT toaddress, fromaddress, subject, message, ''' ''' ackdata, status, ttl, retrynumber, encodingtype FROM ''' ''' sent WHERE (status='msgqueued' or status='forcepow') ''' - ''' and folder='sent' ''') + ''' and folder LIKE '%sent%' ''') # while we have a msg that needs some work for row in queryreturn: toaddress, fromaddress, subject, message, \