From fcf39acfab00617f4938bbca83033e325de7e551 Mon Sep 17 00:00:00 2001 From: Guilhem Allaman <40383801+gounux@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:51:44 +0200 Subject: [PATCH] fix(qchat): no notification on self message mention (#197) --- qtribu/gui/dck_qchat.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/qtribu/gui/dck_qchat.py b/qtribu/gui/dck_qchat.py index 229690cc..6323a0d5 100644 --- a/qtribu/gui/dck_qchat.py +++ b/qtribu/gui/dck_qchat.py @@ -369,15 +369,18 @@ def on_ws_message_received(self, message: str) -> None: message["message"], foreground_color=self.settings.qchat_color_mention, ) - self.log( - message=self.tr("You were mentionned by {sender}: {message}").format( - sender=message["author"], message=message["message"] - ), - application=self.tr("QChat"), - log_level=Qgis.Info, - push=PlgOptionsManager().get_plg_settings().notify_push_info, - duration=PlgOptionsManager().get_plg_settings().notify_push_duration, - ) + if message["author"] != self.settings.author_nickname: + self.log( + message=self.tr( + "You were mentionned by {sender}: {message}" + ).format(sender=message["author"], message=message["message"]), + application=self.tr("QChat"), + log_level=Qgis.Info, + push=PlgOptionsManager().get_plg_settings().notify_push_info, + duration=PlgOptionsManager() + .get_plg_settings() + .notify_push_duration, + ) elif message["author"] == self.settings.author_nickname: item = self.create_message_item( message["author"],