diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-23 08:06:22 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-23 08:18:08 +0200 |
commit | 8f73d303b96d35ccec9856fc0043a74c8800536b (patch) | |
tree | 8c97971ab356fa5f2b463ba97efd768b0908e0a7 /src/Body.cpp | |
parent | aa9a861c662f7c65cde92fbf133deaca3692bbd2 (diff) |
Cleanup embedded item if embedded item refers to a new item, scroll to bottom when posting message/media and last item is already visible
Also show "Loading..." while checking if our matrix token is still
valid.
Diffstat (limited to 'src/Body.cpp')
-rw-r--r-- | src/Body.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index 20e7404..3fd2324 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -461,9 +461,11 @@ namespace QuickMedia { // TODO: Only do this for items that are not visible, do not loop all items. // TODO: Improve performance! right now it can use up to 5-7% cpu with a lot of items! for(auto &body_item : items) { - if(elapsed_time_sec - body_item->last_drawn_time >= 1.5) { + 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()); - } } } |