diff options
Diffstat (limited to 'poezio/core/handlers.py')
-rw-r--r-- | poezio/core/handlers.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py index 9cb9358e..955f8f58 100644 --- a/poezio/core/handlers.py +++ b/poezio/core/handlers.py @@ -1152,18 +1152,23 @@ class HandlerCore: self.core.information( "Connection to remote server failed: %s" % (error, ), 'Error') + def on_session_end(self, event): + """ + Called when a session is terminated (e.g. due to a manual disconnect or a 0198 resume fail) + """ + roster.connected = 0 + roster.modified() + for tab in self.core.get_tabs(tabs.MucTab): + tab.disconnect() + async def on_disconnected(self, event): """ When we are disconnected from remote server """ if 'disconnect' in config.get('beep_on').split(): curses.beep() - roster.connected = 0 # Stop the ping plugin. It would try to send stanza on regular basis self.core.xmpp.plugin['xep_0199'].disable_keepalive() - roster.modified() - for tab in self.core.get_tabs(tabs.MucTab): - tab.disconnect() msg_typ = 'Error' if not self.core.legitimate_disconnect else 'Info' self.core.information("Disconnected from server%s." % (event and ": %s" % event or ""), msg_typ) if self.core.legitimate_disconnect or not config.get( |