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.")