Fixed inconsistency with two unread messages in a conversation

This commit is contained in:
2020-01-20 10:39:38 -06:00
parent d286674cee
commit 7ddca4aec7
2 changed files with 4 additions and 2 deletions

View File

@@ -1129,7 +1129,7 @@ class chatBuffer(baseBuffer):
if "read_state" in msg and msg["read_state"] == 0 and "out" in msg and msg["out"] == 0:
self.session.soundplayer.play("message_unread.ogg")
call_threaded(self.session.vk.client.messages.markAsRead, peer_id=self.kwargs["peer_id"])
self.session.db[self.name]["items"][-1]["read_state"] = 1
[i.update(read_state=1) for i in self.session.db[self.name]["items"]]
if "attachments" in msg and len(msg["attachments"]) > 0:
self.tab.attachments.list.Enable(True)
self.attachments = list()