From 4f8e4d11e51e2436b957157de86755f5f8879f61 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 18 Dec 2020 22:47:10 +0100 Subject: Matrix: get previous messages immediately even if sync in progress --- src/QuickMedia.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/QuickMedia.cpp') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 0789f78..db0f9f6 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -3801,7 +3801,7 @@ namespace QuickMedia { if(tabs[MESSAGES_TAB_INDEX].body->items.size() < 30) { previous_messages_future = [this, ¤t_room]() { Messages messages; - if(matrix->get_previous_room_messages(current_room, messages, true) != PluginResult::OK) + if(matrix->get_previous_room_messages(current_room, messages) != PluginResult::OK) fprintf(stderr, "Failed to get previous matrix messages in room: %s\n", current_room->id.c_str()); return messages; }; @@ -3809,6 +3809,15 @@ namespace QuickMedia { } }; + if(!matrix->is_initial_sync_finished()) { + previous_messages_future = [this, ¤t_room]() { + Messages messages; + if(matrix->get_previous_room_messages(current_room, messages, true) != PluginResult::OK) + fprintf(stderr, "Failed to get previous matrix messages in room: %s\n", current_room->id.c_str()); + return messages; + }; + } + sf::RectangleShape more_messages_below_rect; more_messages_below_rect.setFillColor(sf::Color(128, 50, 50)); -- cgit v1.2.3