| ... |
... |
@@ -676,7 +676,7 @@ class Logger: |
|
676
|
676
|
|
|
677
|
677
|
try:
|
|
678
|
678
|
messages = self.con.execute(
|
|
679
|
|
- sql, (*jids, restore, pending)).fetchall()
|
|
|
679
|
+ sql, tuple(jids) + (restore, pending)).fetchall()
|
|
680
|
680
|
except sqlite.DatabaseError:
|
|
681
|
681
|
self.dispatch('DB_ERROR',
|
|
682
|
682
|
exceptions.DatabaseMalformed(LOG_DB_PATH))
|
| ... |
... |
@@ -722,8 +722,8 @@ class Logger: |
|
722
|
722
|
ORDER BY time, log_line_id
|
|
723
|
723
|
'''.format(jids=', '.join('?' * len(jids)))
|
|
724
|
724
|
|
|
725
|
|
- return self.con.execute(sql, (*jids,
|
|
726
|
|
- date.timestamp(),
|
|
|
725
|
+ return self.con.execute(sql, tuple(jids) +
|
|
|
726
|
+ (date.timestamp(),
|
|
727
|
727
|
(date + delta).timestamp())).fetchall()
|
|
728
|
728
|
|
|
729
|
729
|
def search_log(self, account, jid, query, date=None):
|
| ... |
... |
@@ -765,7 +765,7 @@ class Logger: |
|
765
|
765
|
'''.format(jids=', '.join('?' * len(jids)),
|
|
766
|
766
|
date_search=between if date else '')
|
|
767
|
767
|
|
|
768
|
|
- return self.con.execute(sql, (*jids, query)).fetchall()
|
|
|
768
|
+ return self.con.execute(sql, tuple(jids) + (query,)).fetchall()
|
|
769
|
769
|
|
|
770
|
770
|
def get_days_with_logs(self, account, jid, year, month):
|
|
771
|
771
|
"""
|
| ... |
... |
@@ -803,8 +803,8 @@ class Logger: |
|
803
|
803
|
""".format(jids=', '.join('?' * len(jids)),
|
|
804
|
804
|
kinds=', '.join(kinds))
|
|
805
|
805
|
|
|
806
|
|
- return self.con.execute(sql, (*jids,
|
|
807
|
|
- date.timestamp(),
|
|
|
806
|
+ return self.con.execute(sql, tuple(jids) +
|
|
|
807
|
+ (date.timestamp(),
|
|
808
|
808
|
(date + delta).timestamp())).fetchall()
|
|
809
|
809
|
|
|
810
|
810
|
def get_last_date_that_has_logs(self, account, jid):
|
| ... |
... |
@@ -831,7 +831,7 @@ class Logger: |
|
831
|
831
|
|
|
832
|
832
|
# fetchone() returns always at least one Row with all
|
|
833
|
833
|
# attributes set to None because of the MAX() function
|
|
834
|
|
- return self.con.execute(sql, (*jids,)).fetchone().time
|
|
|
834
|
+ return self.con.execute(sql, tuple(jids)).fetchone().time
|
|
835
|
835
|
|
|
836
|
836
|
def get_room_last_message_time(self, account, jid):
|
|
837
|
837
|
"""
|
| ... |
... |
@@ -1210,7 +1210,7 @@ class Logger: |
|
1210
|
1210
|
'''.format(columns=', '.join(kwargs.keys()),
|
|
1211
|
1211
|
values=', '.join('?' * len(kwargs)))
|
|
1212
|
1212
|
|
|
1213
|
|
- lastrowid = self.con.execute(sql, (jid, time_, kind, *kwargs.values())).lastrowid
|
|
|
1213
|
+ lastrowid = self.con.execute(sql, (jid, time_, kind) + tuple(kwargs.values())).lastrowid
|
|
1214
|
1214
|
|
|
1215
|
1215
|
if unread and kind == KindConstant.CHAT_MSG_RECV:
|
|
1216
|
1216
|
sql = '''INSERT INTO unread_messages (message_id, jid_id)
|