From 3275dced7ef555848b4523251a94a8dbe34dec6d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 5 Jan 2021 08:07:51 +0100 Subject: Fix pinned messages, or something. I dont know --- src/QuickMedia.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 192be5c..c7b5505 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -3686,11 +3686,11 @@ 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(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; body_item->embedded_item->reactions.clear(); + 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->embedded_item->set_description_color(sf::Color(255, 100, 100)); body_item->embedded_item_status = FetchStatus::FINISHED_LOADING; return; } @@ -3713,11 +3713,11 @@ 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(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; body_item->embedded_item->reactions.clear(); + 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->embedded_item->set_description_color(sf::Color(255, 100, 100)); event_data->status = FetchStatus::FINISHED_LOADING; event_data->message = static_cast(related_body_item->userdata); body_item->userdata = event_data; @@ -3767,11 +3767,11 @@ 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(), 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(message->body, current_room->get_user_display_name(me)) || message_contains_user_mention(message->body, 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; body_item->embedded_item->reactions.clear(); + if((related_body_item->userdata && static_cast(related_body_item->userdata)->user == me) || message_contains_user_mention(message->body, current_room->get_user_display_name(me)) || message_contains_user_mention(message->body, me->user_id)) + body_item->embedded_item->set_description_color(sf::Color(255, 100, 100)); body_item->embedded_item_status = FetchStatus::FINISHED_LOADING; return; } -- cgit v1.2.3