From eb2fbdba2efb9c81275461bf3651215b9456e496 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 21 Feb 2020 18:46:09 +0100 Subject: [PATCH] Dont filter out own MUC messages if muc history is set to 'regular' We use the same incoming function as for regular incoming text here. But don't want to filter out our own messages since we didn't print them during sending. Follow up to 8ee2cdadc88978ea26e6b6eb56f2aaa1fd5a81df --- src/event/server_events.c | 2 +- src/ui/mucwin.c | 6 +++--- src/ui/ui.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/event/server_events.c b/src/event/server_events.c index 17543923..ea4277b2 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -324,7 +324,7 @@ sv_ev_room_message(ProfMessage *message) GList *triggers = prefs_message_get_triggers(message->plain); _clean_incoming_message(message); - mucwin_incoming_msg(mucwin, message, mentions, triggers); + mucwin_incoming_msg(mucwin, message, mentions, triggers, TRUE); g_slist_free(mentions); diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index ce542b5f..8f9941d3 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -394,7 +394,7 @@ mucwin_history(ProfMucWin *mucwin, const ProfMessage *const message) GSList *mentions = get_mentions(prefs_get_boolean(PREF_NOTIFY_MENTION_WHOLE_WORD), prefs_get_boolean(PREF_NOTIFY_MENTION_CASE_SENSITIVE), message->plain, mynick); GList *triggers = prefs_message_get_triggers(message->plain); - mucwin_incoming_msg(mucwin, message, mentions, triggers); + mucwin_incoming_msg(mucwin, message, mentions, triggers, FALSE); g_slist_free(mentions); g_list_free_full(triggers, free); @@ -552,12 +552,12 @@ mucwin_outgoing_msg(ProfMucWin *mucwin, const char *const message, const char *c } void -mucwin_incoming_msg(ProfMucWin *mucwin, const ProfMessage *const message, GSList *mentions, GList *triggers) +mucwin_incoming_msg(ProfMucWin *mucwin, const ProfMessage *const message, GSList *mentions, GList *triggers, gboolean filter_reflection) { assert(mucwin != NULL); int flags = 0; - if (message_is_sent_by_us(message, TRUE)) { + if (filter_reflection && message_is_sent_by_us(message, TRUE)) { /* Ignore reflection messages */ return; } diff --git a/src/ui/ui.h b/src/ui/ui.h index 702da631..f0cd296b 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -159,7 +159,7 @@ void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char void mucwin_roster(ProfMucWin *mucwin, GList *occupants, const char *const presence); void mucwin_history(ProfMucWin *mucwin, const ProfMessage *const message); void mucwin_outgoing_msg(ProfMucWin *mucwin, const char *const message, const char *const id, prof_enc_t enc_mode, const char *const replace_id); -void mucwin_incoming_msg(ProfMucWin *mucwin, const ProfMessage *const message, GSList *mentions, GList *triggers); +void mucwin_incoming_msg(ProfMucWin *mucwin, const ProfMessage *const message, GSList *mentions, GList *triggers, gboolean filter_reflection); void mucwin_subject(ProfMucWin *mucwin, const char *const nick, const char *const subject); void mucwin_requires_config(ProfMucWin *mucwin); void mucwin_info(ProfMucWin *mucwin);