diff --git a/src/controller/buffers.py b/src/controller/buffers.py index 37b1cbd..0d1bdab 100644 --- a/src/controller/buffers.py +++ b/src/controller/buffers.py @@ -858,6 +858,11 @@ class chatBuffer(baseBuffer): else: log.debug("Unhandled attachment: %r" % (attachment,)) + def clear_reads(self): + for i in self.session.db[self.name]["items"]: + if "read_state" in i and i["read_state"] == 0: + i["read_state"] = 1 + class peopleBuffer(feedBuffer): def create_tab(self, parent): diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 9d280ab..b8f2258 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -479,6 +479,7 @@ class Controller(object): for i in self.buffers: if hasattr(i, "reads") and len(i.reads) != 0: response = self.session.vk.client.messages.markAsRead(peer_id=i.kwargs["user_id"]) + i.clear_reads() i.reads = [] time.sleep(1)