From cb3c9f03e9cd3add0e3eb0c58ebc582fef8d127c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 22 Nov 2020 14:20:26 +0100 Subject: Matrix: user messages not appearing after re-entering room --- src/QuickMedia.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/QuickMedia.cpp') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 0b91876..9a842dc 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -3852,6 +3852,15 @@ namespace QuickMedia { } }; + auto filter_provisional_messages = [](Messages &messages) { + for(auto it = messages.begin(); it != messages.end();) { + if((*it)->provisional) + it = messages.erase(it); + else + ++it; + } + }; + auto add_new_messages_to_current_room = [&me, &tabs, &selected_tab, ¤t_room, &chat_state](Messages &messages) { if(messages.empty()) return; @@ -4449,6 +4458,7 @@ namespace QuickMedia { all_messages.insert(all_messages.end(), sync_data.messages.begin(), sync_data.messages.end()); filter_existing_messages(sync_data.messages); } + filter_provisional_messages(sync_data.messages); add_new_messages_to_current_room(sync_data.messages); modify_related_messages_in_current_room(sync_data.messages); process_reactions(sync_data.messages); -- cgit v1.2.3