Commit 985746d6 authored by zimio's avatar zimio

only resume when disconnected not on purpose

parent d73e277f
......@@ -776,6 +776,8 @@ class Connection(CommonConnection, ConnectionHandlers):
self.connected = 0
self.time_to_reconnect = None
self.privacy_rules_supported = False
if on_purpose:
self.sm = Smacks(self)
if self.connection:
# make sure previous connection is completely closed
gajim.proxy65_manager.disconnect(self.connection)
......
......@@ -421,9 +421,9 @@ class XMPPDispatcher(PlugIn):
stanza.props = stanza.getProperties()
ID = stanza.getID()
# If server supports stream management
if self.sm and self.sm.enabled and (stanza.getName() != 'r' or
stanza.getName() != 'a' or
stanza.getName() != 'enabled' or
if self.sm and self.sm.enabled and (stanza.getName() != 'r' and
stanza.getName() != 'a' and
stanza.getName() != 'enabled' and
stanza.getName() != 'resumed'):
# increments the number of stanzas that has been handled
self.sm.in_h = self.sm.in_h + 1
......
......@@ -96,10 +96,10 @@ class Smacks():
if len(self.uqueue) < diff or diff < 0:
log.error('Server and client number of stanzas handled mismatch ')
return
else:
while (len(self.uqueue) > diff):
self.uqueue.pop(0)
while (len(self.uqueue) > diff):
self.uqueue.pop(0)
if stanza.getName() == 'resumed':
......
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