From 4f1a3a32c5c5d8f56c3126fca95f3fcc2d8ace81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 5 Oct 2018 21:25:15 +0200 Subject: [PATCH] Fix resume after sm timeout Fixes #9364 --- gajim/common/connection.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gajim/common/connection.py b/gajim/common/connection.py index e57c90e3c..a3234d587 100644 --- a/gajim/common/connection.py +++ b/gajim/common/connection.py @@ -715,9 +715,20 @@ class Connection(CommonConnection, ConnectionHandlers): title=_('Connection with account "%s" has been lost') % self.name, msg=_('Reconnect manually.'))) + def _on_resume_failed(self): + # SM resume failed, set all MUCs offline + # and lose the presence state of all contacts + app.nec.push_incoming_event(OurShowEvent( + None, conn=self, show='offline')) + def _event_dispatcher(self, realm, event, data): CommonConnection._event_dispatcher(self, realm, event, data) - if realm == nbxmpp.NS_REGISTER: + if realm == nbxmpp.NS_STREAM_MGMT: + if event == 'RESUME FAILED': + log.info('Resume failed') + self._on_resume_failed() + + elif realm == nbxmpp.NS_REGISTER: if event == nbxmpp.features_nb.REGISTER_DATA_RECEIVED: # data is (agent, DataFrom, is_form, error_msg) if self.new_account_info and \