fix GC logs: when we create a new room, we call get_last_date_that_has_logs(), which call get_jid_jid, which create a new id for the room, but with type = JID_NORMAL_TYPE instead of JID_ROOM_TYPE. It's now fixed
This commit is contained in:
parent
68a6c88c54
commit
ac0f22887e
2 changed files with 4 additions and 4 deletions
|
@ -860,7 +860,7 @@ class Connection(ConnectionHandlers):
|
||||||
#last date/time in history to avoid duplicate
|
#last date/time in history to avoid duplicate
|
||||||
# FIXME: This JID needs to be normalized; see #1364
|
# FIXME: This JID needs to be normalized; see #1364
|
||||||
jid='%s@%s' % (room, server)
|
jid='%s@%s' % (room, server)
|
||||||
last_log = gajim.logger.get_last_date_that_has_logs(jid)
|
last_log = gajim.logger.get_last_date_that_has_logs(jid, is_room = True)
|
||||||
if last_log is None:
|
if last_log is None:
|
||||||
last_log = 0
|
last_log = 0
|
||||||
self.last_history_line[jid]= last_log
|
self.last_history_line[jid]= last_log
|
||||||
|
|
|
@ -393,11 +393,11 @@ class Logger:
|
||||||
result = self.cur.fetchone()
|
result = self.cur.fetchone()
|
||||||
return days_with_logs
|
return days_with_logs
|
||||||
|
|
||||||
def get_last_date_that_has_logs(self, jid):
|
def get_last_date_that_has_logs(self, jid, is_room = False):
|
||||||
'''returns last time (in seconds since EPOCH) for which
|
'''returns last time (in seconds since EPOCH) for which
|
||||||
we had logs (excluding statuses)'''
|
we had logs (excluding statuses)'''
|
||||||
jid = jid.lower()
|
jid = jid.lower()
|
||||||
jid_id = self.get_jid_id(jid)
|
jid_id = self.get_jid_id(jid, 'ROOM')
|
||||||
self.cur.execute('''
|
self.cur.execute('''
|
||||||
SELECT time FROM logs
|
SELECT time FROM logs
|
||||||
WHERE jid_id = ?
|
WHERE jid_id = ?
|
||||||
|
|
Loading…
Add table
Reference in a new issue