aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index fa8dd66..6ed695b 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -5462,28 +5462,21 @@ namespace QuickMedia {
// TODO: What if these never end up referencing events? clean up automatically after a while?
Messages unreferenced_events;
- auto set_body_as_deleted = [&current_room](Message *message, BodyItem *body_item) {
+ auto set_body_as_deleted = [](Message *message, BodyItem *body_item) {
//body_item->embedded_item = nullptr;
//body_item->embedded_item_status = FetchStatus::NONE;
message->type = MessageType::REDACTION;
//message->related_event_id.clear();
//message->related_event_type = RelatedEventType::NONE;
Message *original_message = static_cast<Message*>(body_item->userdata);
- if(original_message && !is_system_message_type(original_message->type)) {
- body_item->thumbnail_url = current_room->get_user_avatar_url(original_message->user);
- if(body_item->thumbnail_url.empty()) {
- body_item->thumbnail_url = get_resource_loader_root_path() + std::string("images/no_avatar.png");
- body_item->thumbnail_is_local = true;
- }
- body_item->thumbnail_mask_type = ThumbnailMaskType::CIRCLE;
+ if(original_message && original_message->type != MessageType::REDACTION) {
+ body_item->set_description(body_item->get_description() + " (deleted)");
+ if(is_system_message_type(original_message->type))
+ body_item->set_description_color(get_theme().faded_text_color);
+ else
+ body_item->set_description_color(get_theme().text_color);
+ original_message->type = MessageType::REDACTION; // shit garbage fuck
}
- body_item->set_description("Message deleted");
- if(original_message && is_system_message_type(original_message->type))
- body_item->set_description_color(get_theme().faded_text_color);
- else
- body_item->set_description_color(get_theme().text_color);
- body_item->thumbnail_size = AVATAR_THUMBNAIL_SIZE;
- body_item->url.clear();
};
// TODO: Optimize with hash map?