From aaccec79cf9e4f8182716e193dae66686489ecec Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 19 Aug 2012 22:35:46 +0200 Subject: [PATCH] don't try only last_connection_type, but try it it first. Fixes #7002 --- src/common/connection.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 654f74677..edf65b636 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -1102,13 +1102,16 @@ class Connection(CommonConnection, ConnectionHandlers): log.debug('Connection to next host') if len(self._hosts): # No config option exist when creating a new account - if self.last_connection_type: - self._connection_types = [self.last_connection_type] - elif self.name in gajim.config.get_per('accounts'): + if self.name in gajim.config.get_per('accounts'): self._connection_types = gajim.config.get_per('accounts', self.name, 'connection_types').split() else: self._connection_types = ['tls', 'ssl', 'plain'] + if self.last_connection_type: + if self.last_connection_type in self._connection_types: + self._connection_types.remove(self.last_connection_type) + self._connection_types.insert(0, self.last_connection_type) + if self._proxy and self._proxy['type']=='bosh': # with BOSH, we can't do TLS negotiation with , we do only "plain"