Disable ZeroConf account by default
This commit is contained in:
		
							parent
							
								
									3fbce77818
								
							
						
					
					
						commit
						1935a4f40e
					
				
					 3 changed files with 24 additions and 22 deletions
				
			
		|  | @ -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) | ||||
|  |  | |||
|  | @ -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] = \ | ||||
|  |  | |||
|  | @ -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. | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue