Philipp Hörist pushed to branch master at gajim / gajim

Commits:
1935a4f4 by Philipp Hörist at 2018-03-07T20:24:08+01:00
Disable ZeroConf account by default

- - - - -


3 changed files:

- gajim/common/zeroconf/connection_zeroconf.py
- gajim/gui_interface.py
- gajim/roster_window.py


Changes:

=====================================
gajim/common/zeroconf/connection_zeroconf.py
=====================================
--- a/gajim/common/zeroconf/connection_zeroconf.py
+++ b/gajim/common/zeroconf/connection_zeroconf.py
@@ -76,24 +76,6 @@ class ConnectionZeroconf(CommonConnection, 
ConnectionHandlersZeroconf):
         Get name, host, port from config, or create zeroconf account with 
default
         values
         """
-        if not app.config.get_per('accounts', app.ZEROCONF_ACC_NAME, 'name'):
-            log.debug('Creating zeroconf account')
-            app.config.add_per('accounts', app.ZEROCONF_ACC_NAME)
-            app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
-                    'autoconnect', True)
-            app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, 'no_log_for',
-                    '')
-            app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, 'password',
-                    'zeroconf')
-            app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
-                    'sync_with_global_status', True)
-
-            app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
-                    'custom_port', 5298)
-            app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
-                    'is_zeroconf', True)
-            app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
-                    'use_ft_proxies', False)
         self.host = socket.gethostname()
         app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, 'hostname',
                 self.host)


=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -2659,6 +2659,29 @@ class Interface:
                     log.info('Disconnect %s', connection.name)
                     connection.disconnectedReconnCB()
 
+    def create_zeroconf_default_config(self):
+        if app.config.get_per('accounts', app.ZEROCONF_ACC_NAME, 'name'):
+            return
+        log.info('Creating zeroconf account')
+        app.config.add_per('accounts', app.ZEROCONF_ACC_NAME)
+        app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
+                'autoconnect', True)
+        app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, 'no_log_for',
+                '')
+        app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, 'password',
+                'zeroconf')
+        app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
+                'sync_with_global_status', True)
+
+        app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
+                'custom_port', 5298)
+        app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
+                'is_zeroconf', True)
+        app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
+                'use_ft_proxies', False)
+        app.config.set_per('accounts', app.ZEROCONF_ACC_NAME,
+                'active', False)
+
     def run(self, application):
         if app.config.get('trayicon') != 'never':
             self.show_systray()
@@ -2840,6 +2863,7 @@ class Interface:
         self.create_core_handlers_list()
         self.register_core_handlers()
 
+        self.create_zeroconf_default_config()
         if app.config.get_per('accounts', app.ZEROCONF_ACC_NAME, 'active') \
         and app.HAVE_ZEROCONF:
             app.connections[app.ZEROCONF_ACC_NAME] = \


=====================================
gajim/roster_window.py
=====================================
--- a/gajim/roster_window.py
+++ b/gajim/roster_window.py
@@ -5886,10 +5886,6 @@ class RosterWindow:
             # Open wizard only after roster is created, so we can make it
             # transient for the roster window
             GLib.idle_add(_open_wizard)
-        if not app.ZEROCONF_ACC_NAME in app.config.get_per('accounts'):
-            # Create zeroconf in config file
-            from gajim.common.zeroconf import connection_zeroconf
-            connection_zeroconf.ConnectionZeroconf(app.ZEROCONF_ACC_NAME)
 
         # Setting CTRL+J to be the shortcut for bringing up the dialog to join 
a
         # conference.



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/1935a4f40e96361bbb026487849eb176b55892aa

---
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/1935a4f40e96361bbb026487849eb176b55892aa
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to