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.
This commit is contained in:
Philipp Hörist 2017-07-10 20:47:49 +02:00
parent a818b60ba7
commit cc682d243f
3 changed files with 12 additions and 5 deletions

View File

@ -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') ], '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 ], 'use_gpg_agent': [ opt_bool, False ],
'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')], '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_lines': [opt_int, 10, _('How many history messages should be restored when a chat tab/window is reopened?')],
'restore_timeout': [opt_int, 60, _('How many minutes should last lines from previous conversation last.')], 'restore_timeout': [opt_int, -1, _('How far back in time (minutes) history is restored. -1 means no limit.')],
'muc_restore_lines': [opt_int, 20, _('How many lines to request from server when entering a groupchat. -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, 60, _('Minutes of backlog to request 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_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?')], '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).')], 'send_on_ctrl_enter': [opt_bool, False, _('Send message on Ctrl+Enter and with Enter make new line (Mirabilis ICQ Client default behaviour).')],

View File

@ -30,7 +30,7 @@ import os.path
docdir = '../' docdir = '../'
basedir = '../' basedir = '../'
localedir = '../po' localedir = '../po'
version = '0.16.10.4' version = '0.16.10.5'
try: try:
node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True, node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,

View File

@ -238,6 +238,8 @@ class OptionsParser:
self.update_config_to_016103() self.update_config_to_016103()
if old < [0, 16, 10, 4] and new >= [0, 16, 10, 4]: if old < [0, 16, 10, 4] and new >= [0, 16, 10, 4]:
self.update_config_to_016104() 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.init_vars()
gajim.logger.attach_cache_database() gajim.logger.attach_cache_database()
@ -1005,3 +1007,8 @@ class OptionsParser:
def update_config_to_016104(self): def update_config_to_016104(self):
gajim.config.set('emoticons_theme', 'noto-emoticons') gajim.config.set('emoticons_theme', 'noto-emoticons')
gajim.config.set('version', '0.16.10.4') 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')