aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-01-03 01:57:19 +0100
committerdec05eba <dec05eba@protonmail.com>2021-01-03 01:57:19 +0100
commit41c55610d9701ce6bafb475babfa03186e9b961b (patch)
treebf8f81c8c345465354ae09cd4d05282bea9f5003
parent2e348b4bf3ae59af88b9481007fdc7c0a7bec9e1 (diff)
Matrix: fix crash when loading pinned messages
-rw-r--r--src/QuickMedia.cpp4
1 files 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<Message*>(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<Message*>(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<BodyItem>("");
*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<Message*>(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<Message*>(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<BodyItem>("");
*body_item->embedded_item = *related_body_item;