From 8af5901fb893c3fc25b31bf484a90b47d1c24c2c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 10 Aug 2021 13:01:50 +0200 Subject: Matrix: add ctrl+p/ctrl+d to pin/unpin messages --- plugins/Matrix.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index e94cc13..39e0a57 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -119,7 +119,7 @@ namespace QuickMedia { void release_room_lock(); const std::vector>& get_messages_thread_unsafe() const; - const std::vector& get_pinned_events_unsafe() const; + const std::vector& get_pinned_events_thread_unsafe() const; bool has_prev_batch(); void set_prev_batch(const std::string &new_prev_batch); @@ -137,7 +137,7 @@ namespace QuickMedia { std::string get_avatar_url(); void set_pinned_events(std::vector new_pinned_events); - std::set& get_tags_unsafe(); + std::set& get_tags_thread_unsafe(); void clear_data(); @@ -543,6 +543,9 @@ namespace QuickMedia { // |message| is from |BodyItem.userdata| and is of type |Message*| PluginResult delete_message(RoomData *room, void *message, std::string &err_msg); + PluginResult pin_message(RoomData *room, const std::string &event_id); + PluginResult unpin_message(RoomData *room, const std::string &event_id); + PluginResult load_cached_session(); PluginResult on_start_typing(RoomData *room); @@ -588,6 +591,8 @@ namespace QuickMedia { std::string body_to_formatted_body(RoomData *room, const std::string &body); std::string create_formatted_body_for_message_reply(RoomData *room, const Message *message, const std::string &body); + PluginResult set_pinned_events(RoomData *room, const std::vector &pinned_events, bool is_add); + PluginResult set_qm_last_read_message_timestamp(RoomData *room, int64_t timestamp); PluginResult parse_sync_response(const rapidjson::Document &root, bool is_additional_messages_sync, bool initial_sync); -- cgit v1.2.3