Commit db727675 authored by zimio's avatar zimio

resuming from prefered location

parent e02088e9
......@@ -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']
......
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment