diff --git a/qtribu/gui/dck_qchat.py b/qtribu/gui/dck_qchat.py index 6323a0d5..d37e90e1 100644 --- a/qtribu/gui/dck_qchat.py +++ b/qtribu/gui/dck_qchat.py @@ -381,6 +381,12 @@ def on_ws_message_received(self, message: str) -> None: .get_plg_settings() .notify_push_duration, ) + + # check if a notification sound should be played + if self.settings.qchat_play_sounds: + play_resource_sound( + self.settings.qchat_ring_tone, self.settings.qchat_sound_volume + ) elif message["author"] == self.settings.author_nickname: item = self.create_message_item( message["author"], @@ -397,15 +403,6 @@ def on_ws_message_received(self, message: str) -> None: self.twg_chat.addTopLevelItem(item) self.twg_chat.scrollToItem(item) - # check if a notification sound should be played - if ( - self.settings.qchat_play_sounds - and message["author"] != self.settings.author_nickname - ): - play_resource_sound( - self.settings.qchat_ring_tone, self.settings.qchat_sound_volume - ) - def handle_internal_message(self, message: dict[str, Any]) -> None: """ Handle an internal message, spotted by its author