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 = ''