Online notification is shown onli at startup
This commit is contained in:
parent
0e96ed1519
commit
c2c79ca9ec
@ -198,7 +198,7 @@ class Controller(object):
|
|||||||
self.create_longpoll_thread()
|
self.create_longpoll_thread()
|
||||||
self.status_setter = RepeatingTimer(280, self.set_online)
|
self.status_setter = RepeatingTimer(280, self.set_online)
|
||||||
self.status_setter.start()
|
self.status_setter.start()
|
||||||
self.set_online()
|
self.set_online(notify=True)
|
||||||
self.create_unread_messages()
|
self.create_unread_messages()
|
||||||
wx.CallAfter(self.get_audio_albums, self.session.user_id)
|
wx.CallAfter(self.get_audio_albums, self.session.user_id)
|
||||||
wx.CallAfter(self.get_video_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)
|
rendered_message = renderers.render_message(message, self.session)
|
||||||
output.speak(rendered_message[0])
|
output.speak(rendered_message[0])
|
||||||
|
|
||||||
def set_online(self):
|
def set_online(self, notify=False):
|
||||||
try:
|
try:
|
||||||
r = self.session.vk.client.account.setOnline()
|
r = self.session.vk.client.account.setOnline()
|
||||||
except:
|
except:
|
||||||
log.error("Error in setting online for the current user")
|
log.error("Error in setting online for the current user")
|
||||||
|
if notify:
|
||||||
self.window.notify("Socializer", "online now!")
|
self.window.notify("Socializer", "online now!")
|
||||||
|
|
||||||
def set_offline(self):
|
def set_offline(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user