From ba0f42d30f87ca80ac933137cba5995f4f2c39bf Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 11 Feb 2021 22:23:58 +0100 Subject: Matrix: mark local edit/reply as read --- plugins/Matrix.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 9fb35fe..7028e4d 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -76,7 +76,7 @@ namespace QuickMedia { RelatedEventType related_event_type = RelatedEventType::NONE; bool notification_mentions_me = false; bool cache = false; - bool provisional = false; + std::string transaction_id; time_t timestamp = 0; // In milliseconds MessageType type; std::shared_ptr replaced_by = nullptr; @@ -204,6 +204,7 @@ namespace QuickMedia { bool message_contains_user_mention(const std::string &msg, const std::string &username); bool message_is_timeline(Message *message); void body_set_selected_item(Body *body, BodyItem *selected_item); + std::string create_transaction_id(); enum class MatrixPageType { ROOM_LIST, @@ -459,7 +460,8 @@ namespace QuickMedia { // TODO: Make api better. PluginResult post_message(RoomData *room, const std::string &body, std::string &event_id_response, const std::optional &file_info, const std::optional &thumbnail_info, const std::string &msgtype = ""); // |relates_to| is from |BodyItem.userdata| and is of type |Message*| - PluginResult post_reply(RoomData *room, const std::string &body, void *relates_to, std::string &event_id_response); + // If |custom_transaction_id| is empty, then a new transaction id is generated + PluginResult post_reply(RoomData *room, const std::string &body, void *relates_to, std::string &event_id_response, const std::string &custom_transaction_id = ""); // |relates_to| is from |BodyItem.userdata| and is of type |Message*| PluginResult post_edit(RoomData *room, const std::string &body, void *relates_to, std::string &event_id_response); // |relates_to| is from |BodyItem.userdata| and is of type |Message*| -- cgit v1.2.3