From 13935702620305c5baaf6403417cc75a9b706fea Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 1 Nov 2020 13:24:16 +0100 Subject: Matrix: create room immediately after receiving join response, instead of waiting for join sync message --- plugins/Matrix.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 3d3c4b2..6a876d0 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -423,11 +423,14 @@ namespace QuickMedia { PluginResult upload_file(RoomData *room, const std::string &filepath, UploadInfo &file_info, UploadInfo &thumbnail_info, std::string &err_msg); void add_room(std::unique_ptr room); void remove_room(const std::string &room_id); + void set_invite(const std::string &room_id, Invite invite); + // Returns true if an invite for |room_id| exists + bool remove_invite(const std::string &room_id); 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::vector> rooms; std::unordered_map room_data_by_id; // value is an index into |rooms| - std::mutex room_data_mutex; + std::recursive_mutex room_data_mutex; std::string user_id; std::string username; std::string access_token; @@ -436,8 +439,10 @@ namespace QuickMedia { std::string next_batch; std::unordered_map invites; + std::mutex invite_mutex; std::thread sync_thread; bool sync_running = false; + MatrixDelegate *delegate = nullptr; }; } \ No newline at end of file -- cgit v1.2.3