diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-01-05 08:07:51 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-01-05 08:07:51 +0100 |
commit | 3275dced7ef555848b4523251a94a8dbe34dec6d (patch) | |
tree | 1a7e591f713014f95657a40142e8b70a5784473d /src | |
parent | 9d07e4df1792a3b5a28b41a4dfc47da875d00546 (diff) |
Fix pinned messages, or something. I dont know
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<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; body_item->embedded_item->reactions.clear(); + 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->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<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; body_item->embedded_item->reactions.clear(); + 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->embedded_item->set_description_color(sf::Color(255, 100, 100)); event_data->status = FetchStatus::FINISHED_LOADING; event_data->message = static_cast<Message*>(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<Message*>(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<BodyItem>(""); *body_item->embedded_item = *related_body_item; body_item->embedded_item->reactions.clear(); + if((related_body_item->userdata && static_cast<Message*>(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; } |