From 785a3f0a062247910f1ae988c141a7c613a90d51 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 17 Dec 2023 01:25:10 +0100 Subject: Matrix: keep edited in progress message on esc, clear text when going from edit to insert/reply --- plugins/Matrix.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins/Matrix.hpp') diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index de66481..a3ce633 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -238,7 +238,6 @@ namespace QuickMedia { int notification_power_level = 50; size_t index = 0; std::atomic gpg_decrypt_message_id = 0; - std::string chat_message; private: std::mutex user_mutex; std::recursive_mutex room_mutex; @@ -257,6 +256,11 @@ namespace QuickMedia { std::set tags; }; + struct RoomExtraData { + std::string chat_message; + std::string editing_message_id; + }; + struct Invite { std::string room_name; std::string room_avatar_url; @@ -745,6 +749,8 @@ namespace QuickMedia { std::string get_media_url(const std::string &mxc_id); + RoomExtraData& get_room_extra_data(RoomData *room); + void append_system_message(RoomData *room_data, std::shared_ptr message); std::string body_to_formatted_body(RoomData *room, const std::string &body); void on_exit_room(RoomData *room); @@ -847,5 +853,7 @@ namespace QuickMedia { MessageQueue> decrypt_task; std::thread decrypt_thread; + + std::unordered_map room_extra_data_by_id; }; } \ No newline at end of file -- cgit v1.2.3