From f0a020814794a14760d5aa90493117ea3667e61f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 5 Oct 2023 23:37:52 +0200 Subject: Only decrypt gpg message in room list if its the latest message --- plugins/Matrix.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 6cc3668..68081d8 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -59,7 +59,7 @@ namespace QuickMedia { DECRYPTED }; - MatrixChatBodyItemData(Matrix *matrix, std::string text_to_decrypt) : matrix(matrix), text_to_decrypt(std::move(text_to_decrypt)) {} + MatrixChatBodyItemData(Matrix *matrix, std::string text_to_decrypt, RoomData *room = nullptr, uint64_t gpg_decrypt_message_id = 0) : matrix(matrix), text_to_decrypt(std::move(text_to_decrypt)), room(room), gpg_decrypt_message_id(gpg_decrypt_message_id) {} ~MatrixChatBodyItemData(); void draw_overlay(mgl::Window&, const Widgets &widgets) override; @@ -67,6 +67,8 @@ namespace QuickMedia { std::shared_ptr decrypt_job; Matrix *matrix = nullptr; std::string text_to_decrypt; + RoomData *room = nullptr; + uint64_t gpg_decrypt_message_id = 0; }; // TODO: Remove. Not needed anymore. @@ -235,6 +237,7 @@ namespace QuickMedia { int notification_power_level = 50; size_t index = 0; + std::atomic gpg_decrypt_message_id = 0; private: std::mutex user_mutex; std::recursive_mutex room_mutex; -- cgit v1.2.3