Commit d05140a1 authored by Yann Leboulanger's avatar Yann Leboulanger

ability to request room logs without time / number of stanza limit. Fixes #6877

parent aeb598ac
......@@ -168,8 +168,8 @@ class Config:
'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')],
'restore_lines': [opt_int, 4, _('How many lines to remember from previous conversation when a chat tab/window is reopened.')],
'restore_timeout': [opt_int, 60, _('How many minutes should last lines from previous conversation last.')],
'muc_restore_lines': [opt_int, 20, _('How many lines to request to server when entering a groupchat.')],
'muc_restore_timeout': [opt_int, 60, _('How many minutes back to request logs when a entering a groupchat.')],
'muc_restore_lines': [opt_int, 20, _('How many lines to request to server when entering a groupchat. -1 means no limit')],
'muc_restore_timeout': [opt_int, 60, _('How many minutes back to request logs when a entering a groupchat. -1 means no limit')],
'muc_autorejoin_timeout': [opt_int, 1, _('How many seconds to wait before trying to autorejoin to a conference you are being disconnected from. Set to 0 to disable autorejoining.')],
'muc_autorejoin_on_kick': [opt_bool, False, _('Should autorejoin be activated when we are being kicked from a conference?')],
'send_on_ctrl_enter': [opt_bool, False, _('Send message on Ctrl+Enter and with Enter make new line (Mirabilis ICQ Client default behaviour).')],
......@@ -2269,16 +2269,22 @@ def join_gc(self, nick, room_jid, password, change_nick=False):
if not change_nick:
t = p.setTag(common.xmpp.NS_MUC + ' x')
tags = {}
timeout = gajim.config.get('muc_restore_timeout') * 60
if timeout >= 0:
last_date = self.last_history_time[room_jid]
if last_date == 0:
last_date = time.time() - gajim.config.get(
'muc_restore_timeout') * 60
last_date = time.time() - timeout
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})
last_date = min(last_date, time.time() - timeout)
last_date = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(
tags['since'] = last_date
nb = gajim.config.get('muc_restore_lines')
if nb >= 0:
tags['maxstanzas'] = nb
if tags:
t.setTag('history', tags)
if password:
t.setTagData('password', password)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment