Fixed a few bugs

This commit is contained in:
Manuel Cortez 2020-01-30 17:38:56 -06:00
parent 296b4164a7
commit 3f5c79dd05
3 changed files with 6 additions and 2 deletions

View File

@ -15,6 +15,7 @@
* Fixed an error that was making socializer unable to render correctly certain Links containing uppercase letters (such as yandex.disk shared links). Before, those links were giving 404 errors when pressed, now they should work normally. This error was present in wall posts, comments, topics and chat messages. * Fixed an error that was making socializer unable to render correctly certain Links containing uppercase letters (such as yandex.disk shared links). Before, those links were giving 404 errors when pressed, now they should work normally. This error was present in wall posts, comments, topics and chat messages.
* Fixed an error related to chat notifications in Socializer. Before, the "online now" notification could break the Socializer interface, making it unable to load the chat in real time. * Fixed an error related to chat notifications in Socializer. Before, the "online now" notification could break the Socializer interface, making it unable to load the chat in real time.
* Fixed a small inconsistency when marking a conversation as read. Before, if two messages were sent by the recipient, only the last message was marked as read and the previous was making the unread sound all the time. Now that issue should be handled properly. * Fixed a small inconsistency when marking a conversation as read. Before, if two messages were sent by the recipient, only the last message was marked as read and the previous was making the unread sound all the time. Now that issue should be handled properly.
* Some errors, where buffers were not updated, should be handled better due to work in Socializer initialization function which should make the application slightly faster during boot.
### Changes ### Changes

View File

@ -1511,6 +1511,9 @@ class peopleBuffer(feedBuffer):
def update_online(self): def update_online(self):
online_users = self.session.vk.client.friends.getOnline() online_users = self.session.vk.client.friends.getOnline()
now = time.time() now = time.time()
# Attempt to fix a race condition in online buffers.
if self.session.db.get(self.name) == None:
self.session.db[self.name] = dict(items=[])
for i in self.session.db[self.name]["items"]: for i in self.session.db[self.name]["items"]:
if i["id"] in online_users: if i["id"] in online_users:
i["last_seen"]["time"] = now i["last_seen"]["time"] = now

View File

@ -139,8 +139,6 @@ class Controller(object):
pub.sendMessage("create_buffer", buffer_type="emptyBuffer", buffer_title=_("Chats"), kwargs=dict(parent=self.window.tb, name="chats")) pub.sendMessage("create_buffer", buffer_type="emptyBuffer", buffer_title=_("Chats"), kwargs=dict(parent=self.window.tb, name="chats"))
pub.sendMessage("create_buffer", buffer_type="emptyBuffer", buffer_title=_("Timelines"), kwargs=dict(parent=self.window.tb, name="timelines")) pub.sendMessage("create_buffer", buffer_type="emptyBuffer", buffer_title=_("Timelines"), kwargs=dict(parent=self.window.tb, name="timelines"))
wx.CallAfter(self.window.realize) wx.CallAfter(self.window.realize)
self.repeatedUpdate = RepeatingTimer(120, self.update_all_buffers)
self.repeatedUpdate.start()
def complete_buffer_creation(self, buffer, name_, position): def complete_buffer_creation(self, buffer, name_, position):
answer = buffer.get_items() answer = buffer.get_items()
@ -252,6 +250,8 @@ class Controller(object):
wx.CallAfter(self.window.change_status, _("Loading items for {0}").format(i.name,)) wx.CallAfter(self.window.change_status, _("Loading items for {0}").format(i.name,))
i.get_items() i.get_items()
wx.CallAfter(self.window.change_status, _("Ready")) wx.CallAfter(self.window.change_status, _("Ready"))
self.repeatedUpdate = RepeatingTimer(120, self.update_all_buffers)
self.repeatedUpdate.start()
def create_longpoll_thread(self, notify=False): def create_longpoll_thread(self, notify=False):
try: try: