diff options
author | wurstsalat <mailtrash@posteo.de> | 2023-01-13 18:31:39 +0300 |
---|---|---|
committer | wurstsalat <mailtrash@posteo.de> | 2023-01-13 18:31:42 +0300 |
commit | 0b2822a51428f2cfc581764772f519cc69542889 (patch) | |
tree | b28ca07f51a46a08debcee547125ce01bfa27a67 | |
parent | b40d9f04e92573b26c2f65f7aff51cb2e80a78b5 (diff) |
fix: Notifications: Fix rare case where Gajim displays notifications for our own messages
Fixes #11305
-rw-r--r-- | gajim/gtk/chat_stack.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gajim/gtk/chat_stack.py b/gajim/gtk/chat_stack.py index 1655fecad..c787236c4 100644 --- a/gajim/gtk/chat_stack.py +++ b/gajim/gtk/chat_stack.py @@ -377,6 +377,16 @@ class ChatStack(Gtk.Stack, EventHelper): if not event.msgtxt or event.properties.is_sent_carbon: return + client = app.get_client(event.account) + contact = client.get_module('Contacts').get_contact(event.jid) + if isinstance(contact, GroupchatContact): + # MUC messages may be received after some delay, so make sure we + # don't issue notifications for our own messages. + self_contact = contact.get_self() + if (self_contact is not None and + self_contact.name == event.properties.muc_nickname): + return + if app.window.is_chat_active(event.account, event.jid): return |