Online notification is shown onli at startup

This commit is contained in:
Manuel Cortez 2018-12-16 02:20:14 -06:00
parent 0e96ed1519
commit c2c79ca9ec

View File

@ -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,11 +443,12 @@ 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")
if notify:
self.window.notify("Socializer", "online now!")
def set_offline(self):