only resume when disconnected not on purpose

This commit is contained in:
Jefry Lagrange 2011-06-11 16:29:08 -04:00
parent d73e277f40
commit 985746d65a
3 changed files with 8 additions and 6 deletions

View File

@ -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)

View File

@ -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

View File

@ -96,7 +96,7 @@ 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)