register Disconnect handler soon enough

This commit is contained in:
Yann Leboulanger 2008-08-06 21:37:56 +00:00
parent 150979b3ab
commit c7d33bb68e
1 changed files with 1 additions and 1 deletions

View File

@ -615,11 +615,11 @@ class Connection(ConnectionHandlers):
if _con_type != self._current_type: if _con_type != self._current_type:
self.connect_to_next_type() self.connect_to_next_type()
return return
con.RegisterDisconnectHandler(self._on_disconnected)
if _con_type == 'plain' and gajim.config.get_per('accounts', self.name, if _con_type == 'plain' and gajim.config.get_per('accounts', self.name,
'warn_when_plaintext_connection'): 'warn_when_plaintext_connection'):
self.dispatch('PLAIN_CONNECTION', (con,)) self.dispatch('PLAIN_CONNECTION', (con,))
return True return True
con.RegisterDisconnectHandler(self._on_disconnected)
if _con_type in ('tls', 'ssl') and not hasattr(con.Connection, if _con_type in ('tls', 'ssl') and not hasattr(con.Connection,
'_sslContext') and gajim.config.get_per('accounts', self.name, '_sslContext') and gajim.config.get_per('accounts', self.name,
'warn_when_insecure_ssl_connection') and \ 'warn_when_insecure_ssl_connection') and \