resuming from prefered location
This commit is contained in:
parent
e02088e91c
commit
db7276752b
|
@ -997,7 +997,15 @@ class Connection(CommonConnection, ConnectionHandlers):
|
||||||
if self.connection:
|
if self.connection:
|
||||||
return 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']
|
hostname = data['hostname']
|
||||||
self.try_connecting_for_foo_secs = 45
|
self.try_connecting_for_foo_secs = 45
|
||||||
p = data['proxy']
|
p = data['proxy']
|
||||||
|
|
|
@ -25,6 +25,7 @@ class Smacks():
|
||||||
self._owner = None
|
self._owner = None
|
||||||
self.resuming = False
|
self.resuming = False
|
||||||
self.enabled = False # If SM is enabled
|
self.enabled = False # If SM is enabled
|
||||||
|
self.location = None
|
||||||
|
|
||||||
def set_owner(self, owner):
|
def set_owner(self, owner):
|
||||||
self._owner = owner
|
self._owner = owner
|
||||||
|
@ -52,6 +53,9 @@ class Smacks():
|
||||||
if r == 'false' or r == 'False' or r == '0':
|
if r == 'false' or r == 'False' or r == '0':
|
||||||
self.negociate(False)
|
self.negociate(False)
|
||||||
|
|
||||||
|
l = stanza.getAttr('location')
|
||||||
|
if l:
|
||||||
|
self.location = l
|
||||||
self.enabled = True
|
self.enabled = True
|
||||||
|
|
||||||
def negociate(self, resume=True):
|
def negociate(self, resume=True):
|
||||||
|
|
Loading…
Reference in New Issue