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

Commits:
142f2214 by Philipp Hörist at 2017-03-14T22:17:16+01:00
Dont notify on own sent carbon copies

- - - - -
4966b4bf by Philipp Hörist at 2017-03-14T22:17:48+01:00
Remove notifications on receiving own sent carbon copies

Notifications for a JID are removed when we see activity
in the form of a sent carbon copie from one of our other devices.

If we receive such carbon copies we can conclude that the message
we received earlier was answered from one of our other devices.

- - - - -


1 changed file:

- src/session.py


Changes:

=====================================
src/session.py
=====================================
--- a/src/session.py
+++ b/src/session.py
@@ -244,16 +244,21 @@ class 
ChatControlSession(stanza_session.EncryptedStanzaSession):
             event_type = 'single_message_received'
 
         if self.control and obj.mtype != 'normal':
+            # We have a ChatControl open
             obj.show_in_roster = False
             obj.show_in_systray = False
+        elif obj.forwarded and obj.sent:
+            # Its a Carbon Copied Message we sent
+            obj.show_in_roster = False
+            obj.show_in_systray = False
+            gajim.events.remove_events(self.conn.name, fjid, types=['chat'])
         else:
+            # Everything else
             obj.show_in_roster = notify.get_show_in_roster(event_type,
                 self.conn.name, contact, self)
             obj.show_in_systray = notify.get_show_in_systray(event_type,
                 self.conn.name, contact)
 
-        if (not self.control and obj.mtype != 'normal') or \
-        (obj.mtype == 'normal' and not obj.popup):
             event = event_t(obj.msgtxt, obj.subject, obj.mtype, obj.timestamp,
                 obj.encrypted, obj.resource, obj.msg_log_id,
                 correct_id=(obj.id_, obj.correct_id), xhtml=obj.xhtml,



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/69022ab100dc65839c1d9f1e920fe1cdb2cea118...4966b4bf069045966b18321ed77de1cdf0670527
_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to