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

prevent traceback when changing nick

parent 88fe4f8e
No related branches found
No related tags found
No related merge requests found
......@@ -1746,18 +1746,19 @@ class Connection(ConnectionHandlers):
self.add_lang(p)
if not change_nick:
t = p.setTag(common.xmpp.NS_MUC + ' x')
last_date = gajim.logger.get_last_date_that_has_logs(room_jid, self.name,
is_room=True)
if last_date is None:
last_date = time.time() - gajim.config.get('muc_restore_timeout') * 60
else:
last_time = 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})
if password:
t.setTagData('password', password)
last_date = gajim.logger.get_last_date_that_has_logs(room_jid,
self.name, is_room=True)
if last_date is None:
last_date = time.time() - gajim.config.get(
'muc_restore_timeout') * 60
else:
last_time = 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})
if password:
t.setTagData('password', password)
self.connection.send(p)
# last date/time in history to avoid duplicate
......
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