From 56bb6ce225b22efc05af4539e13808b0eb1fbe25 Mon Sep 17 00:00:00 2001
From: wurstsalat <mailtrash@posteo.de>
Date: Sun, 25 Oct 2020 17:48:50 +0100
Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20show=20notifications=20for=20ow?=
 =?UTF-8?q?n=20muc=20messages=20on=20DND?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 gajim/common/connection_handlers_events.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/gajim/common/connection_handlers_events.py b/gajim/common/connection_handlers_events.py
index e6287f4039..8142094110 100644
--- a/gajim/common/connection_handlers_events.py
+++ b/gajim/common/connection_handlers_events.py
@@ -287,14 +287,15 @@ def handle_incoming_gc_msg_event(self, msg_obj):
 
         nick = msg_obj.properties.muc_nickname
 
-        if nick != msg_obj.gc_control.nick:
-            self.do_sound = True
-            if sound == 'received':
-                self.sound_event = 'muc_message_received'
-            elif sound == 'highlight':
-                self.sound_event = 'muc_message_highlight'
-            else:
-                self.do_sound = False
+        if nick == msg_obj.gc_control.nick:
+            # A message from ourself
+            return
+
+        self.do_sound = True
+        if sound == 'received':
+            self.sound_event = 'muc_message_received'
+        elif sound == 'highlight':
+            self.sound_event = 'muc_message_highlight'
         else:
             self.do_sound = False
 
-- 
GitLab