changeset 77e213c484cd in /home/hg/repos/python-nbxmpp
details:http://hg.gajim.org/python-nbxmpp?cmd=changeset;node=77e213c484cd description: Ask for discovery information (and archive) after SM is enabled. Fixes #7299
diffstat:
nbxmpp/auth_nb.py | 1 + nbxmpp/smacks.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-)
diffs (52 lines):
diff -r f9e1827b7d59 -r 77e213c484cd nbxmpp/auth_nb.py --- a/nbxmpp/auth_nb.py Sun Feb 10 11:28:44 2013 +0100 +++ b/nbxmpp/auth_nb.py Sat Feb 23 11:42:07 2013 -0400 @@ -692,6 +692,7 @@ sm = self._owner._caller.sm if self.supports_sm: # starts negociation + sm.supports_sm = True sm.set_owner(self._owner) sm.negociate() self._owner.Dispatcher.sm = sm diff -r f9e1827b7d59 -r 77e213c484cd nbxmpp/smacks.py --- a/nbxmpp/smacks.py Sun Feb 10 11:28:44 2013 +0100 +++ b/nbxmpp/smacks.py Sat Feb 23 11:42:07 2013 -0400 @@ -25,10 +25,11 @@ self.resuming = False self.enabled = False # If SM is enabled self.location = None + self.failed_resume = False # If last resuming attempt failed + self.supports_sm = False # If server supports sm
def set_owner(self, owner): self._owner = owner - # Register handlers owner.Dispatcher.RegisterNamespace(NS_STREAM_MGMT) owner.Dispatcher.RegisterHandler('enabled', self._neg_response, @@ -47,13 +48,14 @@ if r == 'true' or r == 'True' or r == '1': self.resumption = True self.session_id = stanza.getAttr('id') - if r == 'false' or r == 'False' or r == '0': self.negociate(False) - l = stanza.getAttr('location') if l: self.location = l + if self.failed_resume: + self.con._discover_server_at_connection(self.con.connection) + self.failed_resume = False
def negociate(self, resume=True): # Every time we attempt to negociate, we must erase all previous info @@ -119,6 +121,7 @@ # we need to bind a resource self._owner.NonBlockingBind.resuming = False self._owner._on_auth_bind(None) + self.failed_resume = True return
# Doesn't support resumption