From c36d883a90dac83b5a227ebd2d88b7b868d9f422 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 17 Nov 2020 03:34:36 +0100 Subject: Matrix: attempt to fix fetching previous messages before initial sync is finished fetching old messages --- src/plugins/Matrix.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 199cba5..e53df9c 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -2280,9 +2280,8 @@ namespace QuickMedia { PluginResult Matrix::get_previous_room_messages(RoomData *room_data, bool latest_messages) { std::string from = room_data->get_prev_batch(); - if(latest_messages) - from = "END"; - else if(from.empty()) { + if(from.empty()) { + #if 0 fprintf(stderr, "Info: missing previous batch for room: %s, using /sync next batch\n", room_data->id.c_str()); // TODO: When caching /sync, remember to add lock around getting next_batch! from = get_next_batch(); @@ -2290,6 +2289,8 @@ namespace QuickMedia { fprintf(stderr, "Error: missing next batch!\n"); return PluginResult::OK; } + #endif + from = "END"; } rapidjson::Document request_data(rapidjson::kObjectType); -- cgit v1.2.3