aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-22 07:47:04 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-22 07:47:04 +0100
commit4ddc6897dd53274bb68eb6401715c718a212d9ab (patch)
tree316f83b24d7d2484f92423ab1cef611c8dd490b0 /src
parent600bdbe99f09162ebf264af88ac7cd91d36ac035 (diff)
Matrix: fix embedded text (replies) making body stutter if word wrapping but original item does not
Diffstat (limited to 'src')
-rw-r--r--src/Body.cpp7
-rw-r--r--src/QuickMedia.cpp6
2 files changed, 10 insertions, 3 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 5c2a66c..430c28f 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -67,7 +67,12 @@ namespace QuickMedia {
userdata = other.userdata;
last_drawn_time = other.last_drawn_time;
embedded_item_status = other.embedded_item_status;
- embedded_item = other.embedded_item;
+ if(other.embedded_item) {
+ embedded_item = std::make_shared<BodyItem>("");
+ *embedded_item = *other.embedded_item;
+ } else {
+ embedded_item = nullptr;
+ }
thumbnail_mask_type = other.thumbnail_mask_type;
thumbnail_size = other.thumbnail_size;
title = other.title;
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index f494d35..1bb7a04 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -3601,7 +3601,8 @@ 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) {
- body_item->embedded_item = related_body_item;
+ body_item->embedded_item = std::make_shared<BodyItem>("");
+ *body_item->embedded_item = *related_body_item;
body_item->embedded_item_status = FetchStatus::FINISHED_LOADING;
return;
}
@@ -3673,7 +3674,8 @@ 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) {
- body_item->embedded_item = related_body_item;
+ body_item->embedded_item = std::make_shared<BodyItem>("");
+ *body_item->embedded_item = *related_body_item;
body_item->embedded_item_status = FetchStatus::FINISHED_LOADING;
return;
}