From ef1dd33682ae26b4af1343aaecf443e7cd883674 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 1 Oct 2020 22:21:14 +0200 Subject: Matrix: implement mention/reply notifications --- plugins/Matrix.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 7df29e1..36b8072 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -26,6 +26,8 @@ namespace QuickMedia { std::string url; std::string thumbnail_url; std::string replaces_event_id; + bool mentions_me = false; + time_t timestamp = 0; MessageType type; }; @@ -98,6 +100,8 @@ namespace QuickMedia { PluginResult on_start_typing(const std::string &room_id); PluginResult on_stop_typing(const std::string &room_id); + PluginResult set_read_marker(const std::string &room_id, const Message *message); + // |message| is from |BodyItem.userdata| and is of type |Message*| bool was_message_posted_by_me(const std::string &room_id, void *message) const; @@ -106,13 +110,14 @@ namespace QuickMedia { PluginResult sync_response_to_body_items(const Json::Value &root, RoomSyncMessages &room_messages); PluginResult get_previous_room_messages(const std::string &room_id, RoomData *room_data); void events_add_user_info(const Json::Value &events_json, RoomData *room_data); - void events_add_messages(const Json::Value &events_json, RoomData *room_data, MessageDirection message_dir, RoomSyncMessages *room_messages); + void events_add_messages(const Json::Value &events_json, RoomData *room_data, MessageDirection message_dir, RoomSyncMessages *room_messages, bool has_unread_notifications); void events_set_room_name(const Json::Value &events_json, RoomData *room_data); std::shared_ptr get_edited_message_original_message(RoomData *room_data, std::shared_ptr message); private: std::unordered_map> room_data_by_id; std::string user_id; + std::string username; std::string access_token; std::string homeserver; std::string next_batch; -- cgit v1.2.3