changeset 54b0c0732842 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=54b0c0732842 description: resuming from prefered location
diffstat:
src/common/connection.py | 12 ++++++++++-- src/common/xmpp/smacks.py | 6 +++++- 2 files changed, 15 insertions(+), 3 deletions(-)
diffs (45 lines):
diff -r ac2f9133f663 -r 54b0c0732842 src/common/connection.py --- a/src/common/connection.py Wed Jun 15 19:12:55 2011 -0400 +++ b/src/common/connection.py Wed Jun 15 20:37:07 2011 -0400 @@ -996,8 +996,16 @@ """ 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 -r ac2f9133f663 -r 54b0c0732842 src/common/xmpp/smacks.py --- a/src/common/xmpp/smacks.py Wed Jun 15 19:12:55 2011 -0400 +++ b/src/common/xmpp/smacks.py Wed Jun 15 20:37:07 2011 -0400 @@ -25,6 +25,7 @@ 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 @@
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):