Commit 39a960f3 authored by zimio's avatar zimio

keeps old status after disconnection

parent 7194260f
......@@ -784,6 +784,15 @@ class Connection(CommonConnection, ConnectionHandlers):
self.connection.disconnect()
self.last_connection = None
self.connection = None
def set_oldst(self): # Set old state
if self.old_show:
self.connected = gajim.SHOW_LIST.index(self.old_show)
gajim.nec.push_incoming_event(OurShowEvent(None, conn=self,
show=self.connected))
else: # we default to online
self.connected = 2
gajim.nec.push_incoming_event(OurShowEvent(None, conn=self,
show=gajim.SHOW_LIST[self.connected]))
def _disconnectedReconnCB(self):
"""
......
......@@ -421,9 +421,10 @@ class XMPPDispatcher(PlugIn):
stanza.props = stanza.getProperties()
ID = stanza.getID()
# If server supports stream management
if self.sm != None and (stanza.getName() != 'r' and
stanza.getName() != 'a' and
stanza.getName() != 'enabled') :
if self.sm and self.sm.enabled and (stanza.getName() != 'r' or
stanza.getName() != 'a' or
stanza.getName() != 'enabled' or
stanza.getName() != 'resumed'):
# increments the number of stanzas that has been handled
self.sm.in_h = self.sm.in_h + 1
list_ = ['default'] # we will use all handlers:
......
......@@ -72,7 +72,7 @@ class Smacks():
log.error('Attempted to resume without a valid session id ')
return
resume = Acks()
resume.buildResume(self.in_h, None)#self.session_id)
resume.buildResume(self.in_h, self.session_id)
self._owner.Connection.send(resume, True)
def send_ack(self, disp, stanza):
......@@ -104,6 +104,7 @@ class Smacks():
if stanza.getName() == 'resumed':
self.resuming = True
self.con.set_oldst()
if self.uqueue != []:
for i in self.uqueue:
self._owner.Connection.send(i, False)
......
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