diff --git a/src/common/connection.py b/src/common/connection.py index bbb2cb9747a00d9ff8485eb0a5ef78facb2104cc..46daadfa0c61330f269d739d1f0a01b732f10ad0 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -784,7 +784,16 @@ 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): """ Called when we are disconnected diff --git a/src/common/xmpp/dispatcher_nb.py b/src/common/xmpp/dispatcher_nb.py index ca321e87836a60e8326c6aef25072fea59866274..0f84c196a659378afa4cfa0354cd0262bef5c66d 100644 --- a/src/common/xmpp/dispatcher_nb.py +++ b/src/common/xmpp/dispatcher_nb.py @@ -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: diff --git a/src/common/xmpp/smacks.py b/src/common/xmpp/smacks.py index c0fa77c0eab146267002bfbb45184ace7f04433d..b1b6dac03d33ba1656b9d735308e1d59640b4c42 100644 --- a/src/common/xmpp/smacks.py +++ b/src/common/xmpp/smacks.py @@ -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)