aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-03 04:27:06 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-03 04:27:06 +0100
commit79a575beddfd23dd3103fdb41a9c5b176ee321f3 (patch)
treeff9a04c1f291d6cee5a4ea41d9c1d2ea59fafaee /src/plugins
parente493614b775c3d9c1684a010bac28f0523a103d6 (diff)
Matrix: attach messages to bottom for initial fetch to reduce jumping of body items
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Matrix.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 5a85e8e..96ce789 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -376,7 +376,7 @@ namespace QuickMedia {
// TODO: Binary search?
Message *last_unread_message = nullptr;
for(auto it = messages.rbegin(), end = messages.rend(); it != end; ++it) {
- if((*it)->related_event_type != RelatedEventType::EDIT && (*it)->related_event_type != RelatedEventType::REDACTION && (*it)->timestamp > read_marker_message_timestamp) {
+ if((*it)->timestamp > read_marker_message_timestamp) {
last_unread_message = (*it).get();
break;
}
@@ -400,13 +400,7 @@ namespace QuickMedia {
room_tags_page->move_room_to_top(room);
} else if(is_initial_sync) {
Message *last_message = nullptr;
- for(auto it = messages.rbegin(), end = messages.rend(); it != end; ++it) {
- if((*it)->related_event_type != RelatedEventType::EDIT && (*it)->related_event_type != RelatedEventType::REDACTION) {
- last_message = (*it).get();
- break;
- }
- }
- if(last_message && !messages.empty())
+ if(!messages.empty())
last_message = messages.back().get();
if(last_message)
room_body_item->set_description(matrix->message_get_author_displayname(last_message) + ": " + extract_first_line_elipses(last_message->body, 150));
@@ -3104,6 +3098,7 @@ namespace QuickMedia {
return nullptr;
}
+ // Is this a synapse bug? sometimes lazy_fetch_members doesn't contain all related clients
fprintf(stderr, "User was not available locally, fetched from server...\n");
return parse_user_info(json_root, user_id, room);
}