From a04a8948e1608dac82c5c10e97c0d1522180fa41 Mon Sep 17 00:00:00 2001 From: "jabber.developer2" Date: Mon, 1 Jun 2026 16:31:14 +0300 Subject: [PATCH] fix(chatwin): only fire plugins_post_chat_message_display on incoming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The trigger was wired into outgoing / outgoing-carbon / history paths too, which made plugins like sounds.py play the "new message" sound when opening a chat (history loads), sending a message yourself, or receiving a carbon of your own sent message from another device. Restrict the call to chatwin_incoming_msg — matches the semantic of "a remote party sent a chat message and it was displayed". --- src/ui/chatwin.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index 414d3517..ac8c3dc0 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -399,8 +399,6 @@ chatwin_outgoing_msg(ProfChatWin* chatwin, const char* const message, const char win_print_outgoing((ProfWin*)chatwin, enc_char, id, replace_id, display_message); } - plugins_post_chat_message_display(myjid->barejid, myjid->resourcepart, display_message); - // Save last id and message for LMC // Note: if the same message is to be corrected several times, the id of the original message is used in each case // https://xmpp.org/extensions/xep-0308.html#rules @@ -434,7 +432,6 @@ chatwin_outgoing_carbon(ProfChatWin* chatwin, ProfMessage* message) win_print_outgoing(window, enc_char, message->id, message->replace_id, message->plain); - plugins_post_chat_message_display(message->from_jid->barejid, message->from_jid->resourcepart, message->plain); message->plain = old_plain; int num = wins_get_num(window); @@ -561,7 +558,6 @@ _chatwin_history(ProfChatWin* chatwin, const char* const contact_barejid) if (plugin_msg) msg->plain = plugin_msg; win_print_history((ProfWin*)chatwin, msg); - plugins_post_chat_message_display(msg->from_jid->barejid, msg->from_jid->resourcepart, msg->plain); msg->plain = old_plain; curr = g_slist_next(curr); } @@ -601,7 +597,6 @@ chatwin_db_history(ProfChatWin* chatwin, const gchar* start_time, const gchar* e } else { win_print_history((ProfWin*)chatwin, msg); } - plugins_post_chat_message_display(msg->from_jid->barejid, msg->from_jid->resourcepart, msg->plain); msg->plain = old_plain; curr = g_slist_next(curr); }