Philipp Hörist pushed to branch master at gajim / gajim

Commits:
6f472cc1 by Philipp Hörist at 2017-09-29T12:41:26+02:00
Set message as read before removing an event

When we receive carbons of a conversation, we remove the events once
we receive a carbon from ourself, because that means we anwered from
another device.

This sets these removed messages also as read in the unread_message
table, so they dont popup on restart.

- - - - -


1 changed file:

- gajim/session.py


Changes:

=====================================
gajim/session.py
=====================================
--- a/gajim/session.py
+++ b/gajim/session.py
@@ -247,6 +247,12 @@ class 
ChatControlSession(stanza_session.EncryptedStanzaSession):
             # Its a Carbon Copied Message we sent
             obj.show_in_roster = False
             obj.show_in_systray = False
+            unread_events = app.events.get_events(
+                self.conn.name, fjid, types=['chat'])
+            read_ids = []
+            for msg in unread_events:
+                read_ids.append(msg.msg_log_id)
+            app.logger.set_read_messages(read_ids)
             app.events.remove_events(self.conn.name, fjid, types=['chat'])
             do_event = False
         else:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/6f472cc120142691c6a46ff95cb494b9411ac5c4

---
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/6f472cc120142691c6a46ff95cb494b9411ac5c4
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to