From 31069764704ebfc84588485b5213444e638e0206 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 1 Aug 2021 03:20:11 +0200 Subject: Matrix: merge system messages --- src/QuickMedia.cpp | 7 ++++++- src/plugins/Matrix.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 286e766..c44b8c4 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -5422,13 +5422,18 @@ namespace QuickMedia { tabs[MESSAGES_TAB_INDEX].body->body_item_merge_handler = [](BodyItem *prev_item, BodyItem *this_item) { Message *message = static_cast(this_item->userdata); - if(!message || !prev_item || !prev_item->userdata || is_system_message_type(message->type)) + if(!message || !prev_item || !prev_item->userdata) return false; if(is_visual_media_message_type(message->type) && !this_item->thumbnail_url.empty()) return false; Message *prev_message = static_cast(prev_item->userdata); + if(is_system_message_type(prev_message->type) && is_system_message_type(message->type)) + return true; + else if(is_system_message_type(message->type)) + return false; + if(is_visual_media_message_type(prev_message->type) && !prev_item->thumbnail_url.empty()) return false; diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 8cc98fa..383540d 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -2071,7 +2071,7 @@ namespace QuickMedia { if(!result.empty()) result += '\n'; - result += changed_by_name + " changed the power level of " + change.first + " from " + power_level_to_name(change.second.old_power_level) + " to " + power_level_to_name(change.second.new_power_level); + result += changed_by_name + " changed the power level of " + change.first + " from " + power_level_to_name(change.second.old_power_level) + " to " + power_level_to_name(change.second.new_power_level) + "."; } return result; } -- cgit v1.2.3