aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-08-07 23:09:11 +0200
committerdec05eba <dec05eba@protonmail.com>2021-08-07 23:09:11 +0200
commitc8cf7dd0663395024fd9a1cc07dec8b50c1494ef (patch)
treee3b93a91f1f34a4c73a1ad73faff48def0ec1710 /src
parentcf841ceae019de89205212f5f0188717054c5510 (diff)
Matrix: fix message replies to user no longer being red after edit
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 86177dc..c49c598 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -4783,10 +4783,11 @@ namespace QuickMedia {
if(message->related_event_type == RelatedEventType::REDACTION) {
set_body_as_deleted(message.get(), body_item.get());
} else {
+ // TODO: Properly check reply message objects for mention of user instead of message data, but only when synapse fixes that notifications
+ // are not triggered by reply to a message with our display name/user id.
Message *reply_to_message = static_cast<Message*>(body_item->userdata);
- Message *orig_message = get_original_message(reply_to_message);
body_item->set_description(strip(message_get_body_remove_formatting(message.get())));
- if(message->user != me && (message_contains_user_mention(body_item->get_description(), my_display_name) || message_contains_user_mention(body_item->get_description(), me->user_id) || (orig_message && orig_message->user == me)))
+ if(message->user != me && (message_contains_user_mention(reply_to_message->body, my_display_name) || message_contains_user_mention(reply_to_message->body, me->user_id)))
body_item->set_description_color(get_current_theme().attention_alert_text_color);
else
body_item->set_description_color(get_current_theme().text_color);
@@ -4821,10 +4822,11 @@ namespace QuickMedia {
if(message->related_event_type == RelatedEventType::REDACTION) {
set_body_as_deleted(message.get(), body_item.get());
} else {
+ // TODO: Properly check reply message objects for mention of user instead of message data, but only when synapse fixes that notifications
+ // are not triggered by reply to a message with our display name/user id.
Message *reply_to_message = static_cast<Message*>(body_item->userdata);
- Message *orig_message = get_original_message(reply_to_message);
body_item->set_description(strip(message_get_body_remove_formatting(message.get())));
- if(message->user != me && (message_contains_user_mention(body_item->get_description(), my_display_name) || message_contains_user_mention(body_item->get_description(), me->user_id) || (orig_message && orig_message->user == me)))
+ if(message->user != me && (message_contains_user_mention(reply_to_message->body, my_display_name) || message_contains_user_mention(reply_to_message->body, me->user_id)))
body_item->set_description_color(get_current_theme().attention_alert_text_color);
else
body_item->set_description_color(get_current_theme().text_color);