resuming from prefered location
This commit is contained in:
parent
e02088e91c
commit
db7276752b
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue