1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00

Fix: add plugins_pre_chat_message_display call for outgoing messages

Ensure consistent invocation of `plugins_pre_chat_message_display`
for outgoing messages. Before the change, the function was not
called for sent messages upon sending, but only on fetching
sent messages from DB.

Fix https://github.com/profanity-im/profanity/issues/1917
This commit is contained in:
John Hernandez 2023-11-09 09:39:41 +01:00
parent 16ed7cc187
commit b19f668392

View File

@ -427,15 +427,18 @@ chatwin_outgoing_msg(ProfChatWin* chatwin, const char* const message, char* id,
auto_char char* enc_char = get_enc_char(enc_mode, chatwin->outgoing_char);
auto_jid Jid* myjid = jid_create(connection_get_fulljid());
auto_char char* display_message = plugins_pre_chat_message_display(myjid->barejid, myjid->resourcepart, strdup(message));
if (request_receipt && id) {
win_print_outgoing_with_receipt((ProfWin*)chatwin, enc_char, "me", message, id, replace_id);
win_print_outgoing_with_receipt((ProfWin*)chatwin, enc_char, "me", display_message, id, replace_id);
} else {
win_print_outgoing((ProfWin*)chatwin, enc_char, id, replace_id, message);
win_print_outgoing((ProfWin*)chatwin, enc_char, id, replace_id, display_message);
}
// save last id and message for LMC in case if it's not LMC message
if (id && !replace_id) {
_chatwin_set_last_message(chatwin, id, message);
_chatwin_set_last_message(chatwin, id, display_message);
}
}