diff options
Diffstat (limited to 'plugins/Matrix.hpp')
-rw-r--r-- | plugins/Matrix.hpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index a3ce633..23b0a8a 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -320,7 +320,7 @@ namespace QuickMedia { virtual ~MatrixDelegate() = default; virtual void join_room(RoomData *room) = 0; - virtual void leave_room(RoomData *room, LeaveType leave_type, const std::string &reason) = 0; + virtual void leave_room(RoomData *room, const std::string &event_id, LeaveType leave_type, const std::string &reason) = 0; // Note: calling |room| methods inside this function is not allowed virtual void room_add_tag(RoomData *room, const std::string &tag) = 0; @@ -356,7 +356,7 @@ namespace QuickMedia { MatrixQuickMedia(Program *program, Matrix *matrix, MatrixRoomsPage *rooms_page, MatrixRoomTagsPage *room_tags_page, MatrixInvitesPage *invites_page, MatrixNotificationsPage *notifications_page); void join_room(RoomData *room) override; - void leave_room(RoomData *room, LeaveType leave_type, const std::string &reason) override; + void leave_room(RoomData *room, const std::string &event_id, LeaveType leave_type, const std::string &reason) override; void room_add_tag(RoomData *room, const std::string &tag) override; void room_remove_tag(RoomData *room, const std::string &tag) override; void room_add_new_messages(RoomData *room, const Messages &messages, bool is_initial_sync, MessageDirection message_dir) override; @@ -759,6 +759,11 @@ namespace QuickMedia { MatrixDelegate* get_delegate(); + bool is_another_instance_running() const { return matrix_instance_already_running; } + + void mark_other_notification_as_read(const std::string &event_id); + bool is_other_notification_read(const std::string &event_id) const; + // Calls the |MatrixDelegate| pending events. // Should be called from the main (ui) thread void update(); @@ -783,6 +788,7 @@ namespace QuickMedia { void add_new_invites(); void parse_custom_emoji(const rapidjson::Value &custom_emoji_json); void load_custom_emoji_from_cache(); + void load_other_notifications(); PluginResult get_previous_room_messages(RoomData *room_data, bool latest_messages, size_t &num_new_messages, bool *reached_end = nullptr); void events_add_user_info(const rapidjson::Value &events_json, RoomData *room_data, int64_t timestamp); std::shared_ptr<UserInfo> parse_user_info(const rapidjson::Value &json, const std::string &user_id, RoomData *room_data, int64_t timestamp); @@ -850,6 +856,7 @@ namespace QuickMedia { std::unordered_map<std::string, CustomEmoji> custom_emoji_by_key; std::unordered_set<std::string> silenced_invites; std::unordered_map<std::string, int64_t> qm_read_markers_by_room_cache; + std::unordered_set<std::string> other_notifications_read; MessageQueue<std::shared_ptr<MatrixChatBodyDecryptJob>> decrypt_task; std::thread decrypt_thread; |