diff --git a/src/common/connection.py b/src/common/connection.py index 9913cf737..c543c49f5 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -996,8 +996,16 @@ class Connection(CommonConnection, ConnectionHandlers): """ if self.connection: return self.connection, '' - - if data: + + + if self.sm.resuming and self.sm.location: + # If resuming and server gave a location, connect from there + hostname = self.sm.location + self.try_connecting_for_foo_secs = gajim.config.get_per('accounts', + self.name, 'try_connecting_for_foo_secs') + use_custom = False + + elif data: hostname = data['hostname'] self.try_connecting_for_foo_secs = 45 p = data['proxy'] diff --git a/src/common/xmpp/smacks.py b/src/common/xmpp/smacks.py index b4e2ed46f..658133390 100644 --- a/src/common/xmpp/smacks.py +++ b/src/common/xmpp/smacks.py @@ -25,6 +25,7 @@ class Smacks(): self._owner = None self.resuming = False self.enabled = False # If SM is enabled + self.location = None def set_owner(self, owner): self._owner = owner @@ -51,7 +52,10 @@ class Smacks(): if r == 'false' or r == 'False' or r == '0': self.negociate(False) - + + l = stanza.getAttr('location') + if l: + self.location = l self.enabled = True def negociate(self, resume=True):