diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index bbc3971..f93dde9 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -3378,6 +3378,9 @@ namespace QuickMedia { modify_related_messages_in_current_room(all_messages); process_reactions(all_messages); tabs[MESSAGES_TAB_INDEX].body->select_last_item(); + if(!all_messages.empty() && current_room->initial_prev_messages_fetch) { + current_room->initial_prev_messages_fetch = false; + } std::vector<std::string> pinned_events; matrix->get_all_pinned_events(current_room, pinned_events); @@ -4689,36 +4692,30 @@ namespace QuickMedia { } - RoomData *new_room = matrix->get_room_by_id(current_room->id); - assert(new_room == current_room); - if(current_room) { - //all_messages.clear(); - tabs[MESSAGES_TAB_INDEX].body->clear_items(); - - Messages all_messages_new; - matrix->get_all_synced_room_messages(current_room, all_messages_new); - for(auto &message : all_messages_new) { - fetched_messages_set.insert(message->event_id); - } - all_messages.insert(all_messages.end(), all_messages_new.begin(), all_messages_new.end()); - me = matrix->get_me(current_room); - filter_sent_messages(all_messages_new); - add_new_messages_to_current_room(all_messages_new); - modify_related_messages_in_current_room(all_messages_new); - unresolved_reactions.clear(); - process_reactions(all_messages_new); - if(current_room->initial_prev_messages_fetch) { - current_room->initial_prev_messages_fetch = false; - if(selected_tab == MESSAGES_TAB_INDEX) - tabs[MESSAGES_TAB_INDEX].body->select_last_item(); - } + //all_messages.clear(); + tabs[MESSAGES_TAB_INDEX].body->clear_items(); - std::vector<std::string> pinned_events; - matrix->get_all_pinned_events(current_room, pinned_events); - process_pinned_events(std::move(pinned_events)); - } else { - go_to_previous_page = true; + Messages all_messages_new; + matrix->get_all_synced_room_messages(current_room, all_messages_new); + for(auto &message : all_messages_new) { + fetched_messages_set.insert(message->event_id); } + all_messages.insert(all_messages.end(), all_messages_new.begin(), all_messages_new.end()); + me = matrix->get_me(current_room); + filter_sent_messages(all_messages_new); + add_new_messages_to_current_room(all_messages_new); + modify_related_messages_in_current_room(all_messages_new); + unresolved_reactions.clear(); + process_reactions(all_messages_new); + if(current_room->initial_prev_messages_fetch) { + current_room->initial_prev_messages_fetch = false; + if(selected_tab == MESSAGES_TAB_INDEX) + tabs[MESSAGES_TAB_INDEX].body->select_last_item(); + } + + std::vector<std::string> pinned_events; + matrix->get_all_pinned_events(current_room, pinned_events); + process_pinned_events(std::move(pinned_events)); } if(go_to_previous_page) { |