From 96b1cc524dc06256ff7195c6ec90c105af704f90 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 8 Aug 2011 21:51:31 +0200 Subject: [PATCH] don't play sound when we receive the message we just sent in groupchat. Fixes #6938 --- src/common/connection_handlers_events.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py index e282ca395..0ab7a0d5e 100644 --- a/src/common/connection_handlers_events.py +++ b/src/common/connection_handlers_events.py @@ -2004,11 +2004,15 @@ class NotificationEvent(nec.NetworkIncomingEvent): def handle_incoming_gc_msg_event(self, msg_obj): sound = msg_obj.msg_obj.gc_control.highlighting_for_message( msg_obj.msgtxt, msg_obj.timestamp)[1] - self.do_sound = True - if sound == 'received': - self.sound_event = 'muc_message_received' - elif sound == 'highlight': - self.sound_event = 'muc_message_highlight' + + if msg_obj.nickname != msg_obj.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 else: self.do_sound = False