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:
Yann Leboulanger 2006-03-24 18:46:48 +00:00
parent 68a6c88c54
commit ac0f22887e
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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 = ?