aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-12-17 01:25:10 +0100
committerdec05eba <dec05eba@protonmail.com>2023-12-17 01:25:10 +0100
commit785a3f0a062247910f1ae988c141a7c613a90d51 (patch)
tree6105b414c7ae7589c8a61e1909c42254ddad4517 /plugins
parent7b91566f303b4afd2deeb6c893ee805e4d62fdaf (diff)
Matrix: keep edited in progress message on esc, clear text when going from edit to insert/reply
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Matrix.hpp10
1 files changed, 9 insertions, 1 deletions
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<uint64_t> 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<std::string> 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> 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<std::shared_ptr<MatrixChatBodyDecryptJob>> decrypt_task;
std::thread decrypt_thread;
+
+ std::unordered_map<std::string, RoomExtraData> room_extra_data_by_id;
};
} \ No newline at end of file