Skip to content
Snippets Groups Projects
Commit 97e5283f authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

simplify code to compute how many logs do we request when we re-join a room

parent f577ec9a
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment