diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-17 23:30:16 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-17 23:30:16 +0200 |
commit | 75e088746dbf3ab4cafd5ac16890b134d4b19d2a (patch) | |
tree | babd67fbcbeb1f51dc9965ef1153d7b8a8c9833b /plugins | |
parent | c903b63a470279525cfe87fbbcefce36986de387 (diff) |
Matrix: update room list when joining a room (in another client) without restarting, and set sync retry to 1 sec instead of 50ms
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Matrix.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<RoomData> room, Messages &messages); PluginResult get_previous_room_messages(std::shared_ptr<RoomData> room, Messages &messages); @@ -184,7 +184,9 @@ namespace QuickMedia { void add_room(std::shared_ptr<RoomData> room); DownloadResult download_json(rapidjson::Document &result, const std::string &url, std::vector<CommandArg> additional_args, bool use_browser_useragent = false, std::string *err_msg = nullptr) const; private: - std::unordered_map<std::string, std::shared_ptr<RoomData>> room_data_by_id; + std::vector<std::shared_ptr<RoomData>> rooms; + std::unordered_map<std::string, size_t> 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; |