From 97e5283f888d1ddeb7f08a766741bc27ff1a4d38 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 22 Feb 2012 15:36:35 +0100 Subject: [PATCH] simplify code to compute how many logs do we request when we re-join a room --- src/common/connection.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index e20d84d67..d58e0ee2f 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -2349,15 +2349,11 @@ class Connection(CommonConnection, ConnectionHandlers): last_date = self.last_history_time[room_jid] if last_date == 0: last_date = time.time() - timeout - else: + elif not rejoin: last_date = min(last_date, time.time() - timeout) last_date = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime( last_date)) tags['since'] = last_date - if rejoin: - tags['since'] = time.strftime('%Y-%m-%dT%H:%M:%SZ', - time.gmtime(gajim.logger.get_last_date_that_has_logs( - room_jid, is_room=True))) nb = gajim.config.get('muc_restore_lines') if nb >= 0: tags['maxstanzas'] = nb