From 61ffd6f91f620cfc4d548d169d3918f736777866 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 3 Jan 2010 19:21:39 +0100 Subject: [PATCH] revert wrong behaviour. see #5527 --- src/common/connection.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index e3ebf1fc1..347e30796 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -2016,8 +2016,13 @@ class Connection(CommonConnection, ConnectionHandlers): self.add_lang(p) if not change_nick: t = p.setTag(common.xmpp.NS_MUC + ' x') - last_date = max(self.last_history_time[room_jid], - time.time() - gajim.config.get('muc_restore_timeout') * 60) + last_date = self.last_history_time[room_jid] + if last_date == 0: + last_date = time.time() - gajim.config.get( + 'muc_restore_timeout') * 60 + else: + last_date = min(last_date, time.time() - gajim.config.get( + 'muc_restore_timeout') * 60) last_date = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(last_date)) t.setTag('history', {'maxstanzas': gajim.config.get( 'muc_restore_lines'), 'since': last_date})