From cca89f92604edd39b12310d38d7231055fadbe1a Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Mon, 10 Dec 2018 13:25:30 -0600 Subject: [PATCH] Call to account.setOffline when closing the app to notify everyone about it --- src/controller/mainController.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 068b65b..fdec5f4 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -230,6 +230,7 @@ class Controller(object): def exit(self, *args, **kwargs): log.debug("Receibed an exit signal. closing...") + self.set_offline() self.disconnect_events() self.window.Destroy() wx.GetApp().ExitMainLoop() @@ -422,6 +423,12 @@ class Controller(object): except: log.error("Error in setting online for the current user") + def set_offline(self): + try: + r = self.session.vk.client.account.setOffline() + except: + log.error("Error in setting offline status for the current user") + def create_unread_messages(self): try: log.debug("Getting possible unread messages.")