From 75e088746dbf3ab4cafd5ac16890b134d4b19d2a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 17 Oct 2020 23:30:16 +0200 Subject: Matrix: update room list when joining a room (in another client) without restarting, and set sync retry to 1 sec instead of 50ms --- plugins/Matrix.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins/Matrix.hpp') diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 3cb974f..135549f 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -128,7 +128,7 @@ namespace QuickMedia { class Matrix { public: PluginResult sync(RoomSyncMessages &room_messages); - PluginResult get_joined_rooms(Rooms &rooms); + void get_room_join_updates(Rooms &new_rooms); PluginResult get_all_synced_room_messages(std::shared_ptr room, Messages &messages); PluginResult get_previous_room_messages(std::shared_ptr room, Messages &messages); @@ -184,7 +184,9 @@ namespace QuickMedia { void add_room(std::shared_ptr room); DownloadResult download_json(rapidjson::Document &result, const std::string &url, std::vector additional_args, bool use_browser_useragent = false, std::string *err_msg = nullptr) const; private: - std::unordered_map> room_data_by_id; + std::vector> rooms; + std::unordered_map room_data_by_id; // value is an index into |rooms| + size_t room_list_read_index = 0; std::mutex room_data_mutex; std::string user_id; std::string username; -- cgit v1.2.3