aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-29 13:23:21 +0100
committerdec05eba <dec05eba@protonmail.com>2020-10-29 13:23:21 +0100
commit4c1fac6db69efaea93e500dce9cb1129f2dba75e (patch)
treeb6e0dbd953288751525476521a8c6d69387b0feb
parenta8f1ebca36d90d965e8a55ebc766f659db65b0c1 (diff)
Properly cleanup embedded text items
-rw-r--r--TODO3
-rw-r--r--src/Body.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/TODO b/TODO
index ca6e65a..733e38c 100644
--- a/TODO
+++ b/TODO
@@ -123,4 +123,5 @@ Fetch replies/pinned message using multiple threads.
Replying to edited message shows incorrect body in matrix.
Show in room tags list when there is a message in any of the rooms in the tag.
Apply current search filter when adding new rooms to the room list.
-Cancel video download when pressing escape or closing window (important in matrix). \ No newline at end of file
+Cancel video download when pressing escape or closing window (important in matrix).
+Support webp. \ No newline at end of file
diff --git a/src/Body.cpp b/src/Body.cpp
index 1ea5be2..bc5346f 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -459,9 +459,6 @@ namespace QuickMedia {
for(auto &body_item : items) {
if(elapsed_time_sec - body_item->last_drawn_time >= 1.5)
clear_body_item_cache(body_item.get());
- // The embedded item might or might not refer to another item in |items|, so we have to make sure we also check it
- if(body_item->embedded_item && elapsed_time_sec - body_item->embedded_item->last_drawn_time >= 1.5)
- clear_body_item_cache(body_item.get());
}
}
@@ -546,6 +543,9 @@ namespace QuickMedia {
body_item->timestamp_text.reset();
body_item->dirty_timestamp = true;
}
+
+ if(body_item->embedded_item)
+ clear_body_item_cache(body_item->embedded_item.get());
}
sf::Vector2i Body::get_item_thumbnail_size(BodyItem *item) const {