diff options
-rw-r--r-- | src/QuickMedia.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 5ffc3f6..4489194 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -3712,7 +3712,7 @@ namespace QuickMedia { *body_item->embedded_item = *related_body_item; body_item->embedded_item->embedded_item = nullptr; body_item->embedded_item->reactions.clear(); - if((related_body_item->userdata && static_cast<Message*>(related_body_item->userdata)->user.get() == me) || message_contains_user_mention(body_item->get_description(), my_display_name) || message_contains_user_mention(body_item->get_description(), my_user_id)) + if(message->user->user_id != my_user_id && ((related_body_item->userdata && static_cast<Message*>(related_body_item->userdata)->user.get() == me) || message_contains_user_mention(body_item->get_description(), my_display_name) || message_contains_user_mention(body_item->get_description(), my_user_id))) body_item->set_description_color(sf::Color(255, 100, 100)); else body_item->set_description_color(sf::Color::White); @@ -3747,7 +3747,7 @@ namespace QuickMedia { body_item->userdata = (void*)message; // Note: message has to be valid as long as body_item is used! if(message->related_event_type == RelatedEventType::REDACTION || message->related_event_type == RelatedEventType::EDIT || message->related_event_type == RelatedEventType::REACTION) body_item->visible = false; - if(message_contains_user_mention(body_item->get_description(), my_display_name) || message_contains_user_mention(body_item->get_description(), my_user_id)) + if(message->user->user_id != my_user_id && (message_contains_user_mention(body_item->get_description(), my_display_name) || message_contains_user_mention(body_item->get_description(), my_user_id))) body_item->set_description_color(sf::Color(255, 100, 100)); return body_item; } @@ -3974,8 +3974,8 @@ namespace QuickMedia { set_body_as_deleted(message.get(), body_item.get()); } else { Message *orig_message = static_cast<Message*>(body_item->userdata); - body_item->set_description(message_get_body_remove_formatting(message.get())); - if(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 && message->user != me)) + 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))) body_item->set_description_color(sf::Color(255, 100, 100)); else body_item->set_description_color(sf::Color::White); @@ -4010,8 +4010,8 @@ namespace QuickMedia { set_body_as_deleted(message.get(), body_item.get()); } else { Message *orig_message = static_cast<Message*>(body_item->userdata); - body_item->set_description(message_get_body_remove_formatting(message.get())); - if(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 && message->user != me)) + 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))) body_item->set_description_color(sf::Color(255, 100, 100)); else body_item->set_description_color(sf::Color::White); @@ -5346,6 +5346,8 @@ namespace QuickMedia { if(fetch_message_result.message) { fetch_body_item->embedded_item = message_to_body_item(current_room, fetch_message_result.message.get(), current_room->get_user_display_name(me), me->user_id); fetch_body_item->embedded_item_status = FetchStatus::FINISHED_LOADING; + if(fetch_message_result.message->user == me) + fetch_body_item->set_description_color(sf::Color(255, 100, 100)); } else { fetch_body_item->embedded_item_status = FetchStatus::FAILED_TO_LOAD; } |