From 4eeaa5c2b889a22c23199247ccc87fb717e6cbcb Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 16 Nov 2020 14:26:44 +0100 Subject: Matrix: fix unread red marker when fetching previous messages --- plugins/Matrix.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/Matrix.hpp') diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 7390062..789b301 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -207,7 +207,7 @@ namespace QuickMedia { virtual void room_add_tag(RoomData *room, const std::string &tag) = 0; // Note: calling |room| methods inside this function is not allowed virtual void room_remove_tag(RoomData *room, const std::string &tag) = 0; - virtual void room_add_new_messages(RoomData *room, const Messages &messages, bool is_initial_sync, bool sync_is_cache) = 0; + virtual void room_add_new_messages(RoomData *room, const Messages &messages, bool is_initial_sync, bool sync_is_cache, MessageDirection message_dir) = 0; virtual void add_invite(const std::string &room_id, const Invite &invite) = 0; virtual void remove_invite(const std::string &room_id) = 0; @@ -233,7 +233,7 @@ namespace QuickMedia { void leave_room(RoomData *room, 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, bool sync_is_cache) override; + void room_add_new_messages(RoomData *room, const Messages &messages, bool is_initial_sync, bool sync_is_cache, MessageDirection message_dir) override; void add_invite(const std::string &room_id, const Invite &invite) override; void remove_invite(const std::string &room_id) override; @@ -250,13 +250,14 @@ namespace QuickMedia { MatrixRoomTagsPage *room_tags_page; MatrixInvitesPage *invites_page; private: - void update_room_description(RoomData *room, bool is_initial_sync); + void update_room_description(RoomData *room, Messages &new_messages, bool is_initial_sync); void update_pending_room_messages(MatrixPageType page_type); private: struct RoomMessagesData { Messages messages; bool is_initial_sync; bool sync_is_cache; + MessageDirection message_dir; }; struct Notification { -- cgit v1.2.3