From 483b3ac149a20192fad3cf3691d8cbae87e50cac Mon Sep 17 00:00:00 2001 From: Jean-Marie Traissard Date: Thu, 12 Oct 2006 01:28:09 +0000 Subject: [PATCH] Keep precedent config about playing muc_received_sound or not --- src/common/config.py | 2 +- src/common/optparser.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/common/config.py b/src/common/config.py index 8cd7f5815..7061656ef 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -143,7 +143,7 @@ class Config: 'send_on_ctrl_enter': [opt_bool, False, _('Send message on Ctrl+Enter and with Enter make new line (Mirabilis ICQ Client default behaviour).')], 'show_roster_on_startup': [opt_bool, True], 'key_up_lines': [opt_int, 25, _('How many lines to store for Ctrl+KeyUP.')], - 'version': [ opt_str, '0.10.1.5' ], # which version created the config + 'version': [ opt_str, '0.10.1.6' ], # which version created the config 'search_engine': [opt_str, 'http://www.google.com/search?&q=%s&sourceid=gajim'], 'dictionary_url': [opt_str, 'WIKTIONARY', _("Either custom url with %s in it where %s is the word/phrase or 'WIKTIONARY' which means use wiktionary.")], 'always_english_wikipedia': [opt_bool, False], diff --git a/src/common/optparser.py b/src/common/optparser.py index 269c9bddd..fbb7fba99 100644 --- a/src/common/optparser.py +++ b/src/common/optparser.py @@ -149,6 +149,8 @@ class OptionsParser: self.update_config_to_01014() if old < [0, 10, 1, 5] and new >= [0, 10, 1, 5]: self.update_config_to_01015() + if old < [0, 10, 1, 6] and new >= [0, 10, 1, 6]: + self.update_config_to_01016() gajim.logger.init_vars() gajim.config.set('version', new_version) @@ -325,3 +327,14 @@ class OptionsParser: cur.close() # remove this in 2007 [pysqlite old versions need this] con.close() gajim.config.set('version', '0.10.1.5') + + def update_config_to_01016(self): + '''#2494 : Now we play gc_received_message sound even if + notify_on_all_muc_messages is false. Keep precedent behaviour.''' + if self.old_values.has_key('notify_on_all_muc_messages') and \ + self.old_values['notify_on_all_muc_messages'] == 'False' and \ + gajim.config.get_per('soundevents', 'muc_message_received', 'enabled'): + gajim.config.set_per('soundevents',\ + 'muc_message_received', 'enabled', False) + + gajim.config.set('version', '0.10.1.6')