diff --git a/configure.ac b/configure.ac index 7545378a666baa8321639c457cb64b83f2c32f0e..cc04ee34bc6e7154cc26e45809e0dd85f1440d29 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([Gajim - A Jabber Instant Messager], - [0.12.5.1-dev],[http://trac.gajim.org/],[gajim]) + [0.12.5.2-dev],[http://trac.gajim.org/],[gajim]) AC_PREREQ([2.59]) AC_CONFIG_HEADER(config.h) diff --git a/src/common/config.py b/src/common/config.py index 1f99ef702d685e211b2799529230a81640b69467..f2277f93e94fb3a1c5340ff49155e07bd99be65f 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -67,7 +67,6 @@ class Config: __options = { # name: [ type, default_value, help_string ] 'verbose': [ opt_bool, False, '', True ], - 'alwaysauth': [ opt_bool, False ], 'autopopup': [ opt_bool, False ], 'notify_on_signin': [ opt_bool, True ], 'notify_on_signout': [ opt_bool, False ], @@ -287,6 +286,7 @@ class Config: 'autoconnect_as': [ opt_str, 'online', _('Status used to autoconnect as. Can be online, chat, away, xa, dnd, invisible. NOTE: this option is used only if restore_last_status is disabled'), True ], 'restore_last_status': [ opt_bool, False, _('If enabled, restore the last status that was used.') ], 'autoreconnect': [ opt_bool, True ], + 'autoauth': [ opt_bool, False, _('If True, Contacts requesting authorization will be automatically accepted.')], 'active': [ opt_bool, True], 'proxy': [ opt_str, '', '', True ], 'keyid': [ opt_str, '', '', True ], diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index b4576a455a97ad7da8946c4f971793920a8a7d7f..60c9fbb5cc76131499bd6c7bee290166e68382e4 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -2353,13 +2353,14 @@ def _presenceCB(self, con, prs): if ptype == 'subscribe': log.debug('subscribe request from %s' % who) - if gajim.config.get('alwaysauth') or who.find("@") <= 0 or \ - jid_stripped in self.jids_for_auto_auth or transport_auto_auth: + if gajim.config.get_per('accounts', self.name, 'autoauth') or \ + who.find('@') <= 0 or jid_stripped in self.jids_for_auto_auth or \ + transport_auto_auth: if self.connection: p = common.xmpp.Presence(who, 'subscribed') p = self.add_sha(p) self.connection.send(p) - if who.find("@") <= 0 or transport_auto_auth: + if who.find('@') <= 0 or transport_auto_auth: self.dispatch('NOTIFY', (jid_stripped, 'offline', 'offline', resource, prio, keyID, timestamp, None)) if transport_auto_auth: diff --git a/src/common/defs.py b/src/common/defs.py index e213fdab103618876db3215635eafd358ad39b60..83ef075a35cbbb101c8e6dc7d5220c0d1f61cf04 100644 --- a/src/common/defs.py +++ b/src/common/defs.py @@ -27,7 +27,7 @@ datadir = '../' localedir = '../po' -version = '0.12.5.1-dev' +version = '0.12.5.2-dev' import sys, os.path for base in ('.', 'common'): diff --git a/src/common/optparser.py b/src/common/optparser.py index bc455e1f6531e3f595bed62d261e4c4403bc0dff..5cedeeaca7ed3ffd86c6a26503cc51193eb8e712 100644 --- a/src/common/optparser.py +++ b/src/common/optparser.py @@ -202,6 +202,8 @@ def update_config(self, old_version, new_version): self.update_config_to_01231() if old < [0, 12, 5, 1] and new >= [0, 12, 5, 1]: self.update_config_to_01251() + if old < [0, 12, 5, 2] and new >= [0, 12, 5, 2]: + self.update_config_to_01252() gajim.logger.init_vars() gajim.config.set('version', new_version) @@ -727,4 +729,11 @@ def update_config_to_01251(self): con.close() gajim.config.set('version', '0.12.5.1') + def update_config_to_01252(self): + if 'alwaysauth' in self.old_values: + val = self.old_values['alwaysauth'] + for account in gajim.config.get_per('accounts'): + gajim.config.set_per('accounts', account, 'autoauth', val) + gajim.config.set('version', '0.12.5.2') + # vim: se ts=3: