From cc682d243f0be13e07a9a29dc91a177940f9ac7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Mon, 10 Jul 2017 20:47:49 +0200 Subject: [PATCH] Change defaults on history restore options Set restore timeout inactiv, this should be really an advanced option, probably only set for specific MUCs not as default for every MUC. Set restore_lines to 10, so the User has an indication that Gajim can display history, and that there is probably a setting to adjust. Set muc_restore_lines to 100, this is a try to get a reasonable amount of history, especially in small Groupchats. Most server will limit this to 20-50 anyway. The limit 100 is more of a precaution if we run into a misconfigured server. This is intended as a workaround until we can implement MAM for Groupchats. --- gajim/common/config.py | 8 ++++---- gajim/common/defs.py | 2 +- gajim/common/optparser.py | 7 +++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gajim/common/config.py b/gajim/common/config.py index c520e1194..0bf18292a 100644 --- a/gajim/common/config.py +++ b/gajim/common/config.py @@ -178,10 +178,10 @@ class Config: 'notify_on_new_gmail_email_command': [ opt_str, '', _('Specify the command to run when new mail arrives, e.g.: /usr/bin/getmail -q') ], 'use_gpg_agent': [ opt_bool, False ], 'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')], - 'restore_lines': [opt_int, 4, _('Amount of previous messages to include when reopening a chat')], - '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 from server when entering a groupchat. -1 means no limit')], - 'muc_restore_timeout': [opt_int, 60, _('Minutes of backlog to request when entering a groupchat. -1 means no limit')], + 'restore_lines': [opt_int, 10, _('How many history messages should be restored when a chat tab/window is reopened?')], + 'restore_timeout': [opt_int, -1, _('How far back in time (minutes) history is restored. -1 means no limit.')], + 'muc_restore_lines': [opt_int, 100, _('How many lines to request from server when entering a groupchat. -1 means no limit')], + 'muc_restore_timeout': [opt_int, -1, _('Minutes of backlog to request when 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).')], diff --git a/gajim/common/defs.py b/gajim/common/defs.py index e95fc21f9..57e3c7e6f 100644 --- a/gajim/common/defs.py +++ b/gajim/common/defs.py @@ -30,7 +30,7 @@ import os.path docdir = '../' basedir = '../' localedir = '../po' -version = '0.16.10.4' +version = '0.16.10.5' try: node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True, diff --git a/gajim/common/optparser.py b/gajim/common/optparser.py index 34960d508..b4696334d 100644 --- a/gajim/common/optparser.py +++ b/gajim/common/optparser.py @@ -238,6 +238,8 @@ class OptionsParser: self.update_config_to_016103() if old < [0, 16, 10, 4] and new >= [0, 16, 10, 4]: self.update_config_to_016104() + if old < [0, 16, 10, 5] and new >= [0, 16, 10, 5]: + self.update_config_to_016105() gajim.logger.init_vars() gajim.logger.attach_cache_database() @@ -1005,3 +1007,8 @@ class OptionsParser: def update_config_to_016104(self): gajim.config.set('emoticons_theme', 'noto-emoticons') gajim.config.set('version', '0.16.10.4') + + def update_config_to_016105(self): + gajim.config.set('muc_restore_timeout', -1) + gajim.config.set('restore_timeout', -1) + gajim.config.set('version', '0.16.10.5')