aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);