aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-23 19:26:53 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-23 19:26:53 +0100
commitd7e029c7f64922f4ec38763e9f3350ae9e7de05b (patch)
tree034cc938acacdca2a3354c991bab835c6f53d0f8 /src
parentfd699d287de23771c17e395d79aa38287453a850 (diff)
Matrix: asdf fix scroll to end on additional messages
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp53
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) {