From 5e744a3e8e62985a13ba957c32cd3bfbc8319ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=C3=ABl=20Verrier?= Date: Sun, 3 Jan 2010 01:52:40 +0100 Subject: [PATCH] forgot to remove an useless line in the previous commit... --- src/common/connection.py | 1 - src/common/logger.py | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 6f46cec2d..e3ebf1fc1 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -2016,7 +2016,6 @@ class Connection(CommonConnection, ConnectionHandlers): self.add_lang(p) if not change_nick: t = p.setTag(common.xmpp.NS_MUC + ' x') - last_date = self.last_history_time[room_jid] last_date = max(self.last_history_time[room_jid], time.time() - gajim.config.get('muc_restore_timeout') * 60) last_date = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(last_date)) diff --git a/src/common/logger.py b/src/common/logger.py index 507b29cfa..99075a719 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -974,8 +974,13 @@ class Logger: (account_jid_id, jid_id)) # Then we add all new groups information for group in groups: - self.cur.execute('INSERT INTO roster_group VALUES(?, ?, ?)', - (account_jid_id, jid_id, group)) + try: + self.cur.execute('INSERT INTO roster_group VALUES(?, ?, ?)', + (account_jid_id, jid_id, group)) + except IntegrityError: + # Some servers (like jabberd) seems to put contact twice in the + # roster. So we do nothing if it appears. (see #5206) + pass if name is None: name = ''