From c2c79ca9ec406d728d0056c0f0a50742ef801402 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Sun, 16 Dec 2018 02:20:14 -0600 Subject: [PATCH] Online notification is shown onli at startup --- src/controller/mainController.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index f517375..aa91f70 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -198,7 +198,7 @@ class Controller(object): self.create_longpoll_thread() self.status_setter = RepeatingTimer(280, self.set_online) self.status_setter.start() - self.set_online() + self.set_online(notify=True) self.create_unread_messages() wx.CallAfter(self.get_audio_albums, self.session.user_id) wx.CallAfter(self.get_video_albums, self.session.user_id) @@ -443,12 +443,13 @@ class Controller(object): rendered_message = renderers.render_message(message, self.session) output.speak(rendered_message[0]) - def set_online(self): + def set_online(self, notify=False): try: r = self.session.vk.client.account.setOnline() except: log.error("Error in setting online for the current user") - self.window.notify("Socializer", "online now!") + if notify: + self.window.notify("Socializer", "online now!") def set_offline(self): try: