diff --git a/changelog.md b/changelog.md index 2d6bc30..67cfd6b 100644 --- a/changelog.md +++ b/changelog.md @@ -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 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. +* 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 diff --git a/src/controller/buffers.py b/src/controller/buffers.py index 8d17172..edb627c 100644 --- a/src/controller/buffers.py +++ b/src/controller/buffers.py @@ -1511,6 +1511,9 @@ class peopleBuffer(feedBuffer): def update_online(self): online_users = self.session.vk.client.friends.getOnline() 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"]: if i["id"] in online_users: i["last_seen"]["time"] = now diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 150e050..5bbfe3b 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -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=_("Timelines"), kwargs=dict(parent=self.window.tb, name="timelines")) wx.CallAfter(self.window.realize) - self.repeatedUpdate = RepeatingTimer(120, self.update_all_buffers) - self.repeatedUpdate.start() def complete_buffer_creation(self, buffer, name_, position): answer = buffer.get_items() @@ -252,6 +250,8 @@ class Controller(object): wx.CallAfter(self.window.change_status, _("Loading items for {0}").format(i.name,)) i.get_items() 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): try: