From ac0f22887e8346dfa096d6aa67bb913c12a048cb Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 24 Mar 2006 18:46:48 +0000 Subject: [PATCH] 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 --- src/common/connection.py | 2 +- src/common/logger.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 706a58d03..496ff9188 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -860,7 +860,7 @@ class Connection(ConnectionHandlers): #last date/time in history to avoid duplicate # FIXME: This JID needs to be normalized; see #1364 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: last_log = 0 self.last_history_line[jid]= last_log diff --git a/src/common/logger.py b/src/common/logger.py index a166939e1..5fdc725eb 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -116,7 +116,7 @@ class Logger: and after that all okay''' possible_room_jid, possible_nick = jid.split('/', 1) - + self.cur.execute('SELECT jid_id FROM jids WHERE jid="%s" AND type=%d' %\ (possible_room_jid, constants.JID_ROOM_TYPE)) row = self.cur.fetchone() @@ -393,11 +393,11 @@ class Logger: result = self.cur.fetchone() 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 we had logs (excluding statuses)''' jid = jid.lower() - jid_id = self.get_jid_id(jid) + jid_id = self.get_jid_id(jid, 'ROOM') self.cur.execute(''' SELECT time FROM logs WHERE jid_id = ?