From 41c55610d9701ce6bafb475babfa03186e9b961b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 3 Jan 2021 01:57:19 +0100 Subject: Matrix: fix crash when loading pinned messages --- src/QuickMedia.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 5c9ea36..6be302c 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -3686,7 +3686,7 @@ namespace QuickMedia { // TODO: Optimize from linear search to hash map auto related_body_item = find_body_item_by_event_id(tabs[MESSAGES_TAB_INDEX].body->items.data(), tabs[MESSAGES_TAB_INDEX].body->items.size(), event_data->message->related_event_id); if(related_body_item) { - if((related_body_item->userdata && static_cast(related_body_item->userdata)->user == me) || message_contains_user_mention(event_data->message->body, current_room->get_user_display_name(me)) || message_contains_user_mention(event_data->message->body, me->user_id)) + if((related_body_item->userdata && static_cast(related_body_item->userdata)->user == me) || message_contains_user_mention(related_body_item->get_description(), current_room->get_user_display_name(me)) || message_contains_user_mention(related_body_item->get_description(), me->user_id)) body_item->set_description_color(sf::Color(255, 100, 100)); body_item->embedded_item = std::make_shared(""); *body_item->embedded_item = *related_body_item; @@ -3713,7 +3713,7 @@ namespace QuickMedia { // TODO: Optimize from linear search to hash map auto related_body_item = find_body_item_by_event_id(tabs[MESSAGES_TAB_INDEX].body->items.data(), tabs[MESSAGES_TAB_INDEX].body->items.size(), event_data->event_id); if(related_body_item) { - if((related_body_item->userdata && static_cast(related_body_item->userdata)->user == me) || message_contains_user_mention(event_data->message->body, current_room->get_user_display_name(me)) || message_contains_user_mention(event_data->message->body, me->user_id)) + if((related_body_item->userdata && static_cast(related_body_item->userdata)->user == me) || message_contains_user_mention(related_body_item->get_description(), current_room->get_user_display_name(me)) || message_contains_user_mention(related_body_item->get_description(), me->user_id)) body_item->set_description_color(sf::Color(255, 100, 100)); body_item->embedded_item = std::make_shared(""); *body_item->embedded_item = *related_body_item; -- cgit v1.2.3