From 8071b192b8cecf0b0f422d74678038dd3afbe3bc Mon Sep 17 00:00:00 2001 From: Hiers <47784553+Hiers@users.noreply.github.com> Date: Sun, 11 Sep 2022 23:05:20 +0000 Subject: Line to indicate first unread message (#1147) * First draft of unread line feature. * Minor visual fix. * Removed unnecessary ternary operator. * Extended unread line functionality to work on minimised window or focusing another window. * Fix for unread line not showing when last read message is hidden. * Minor performance improvement. Fix for misbehaving event2order DB at application start. * Fix for possible performance issues when user has joined a large number of rooms. * Fix for breaking macos and clazy builds. * Changed on windows focus function to refresh unread line if room is unread. * Unread line is removed when user sends a message. * Linting. * Fixed unread line to work in standalone room windows. * Switch isRoomUnread for index 0. * Merged try/catch blocks. * Fix for crash on opening a room invite. * Call fullyReadEventId function when used instead of storing it and passing it through. * Function that was meant to sync the unread line was relying on an async function, oops. * Linting again. * More linting... * Minor changes. --- src/Cache.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Cache.h') diff --git a/src/Cache.h b/src/Cache.h index 1545f7e8..7ea659ec 100644 --- a/src/Cache.h +++ b/src/Cache.h @@ -152,6 +152,8 @@ std::optional getEventIndex(const std::string &room_id, std::string_view event_id); std::optional> lastInvisibleEventAfter(const std::string &room_id, std::string_view event_id); +std::optional> +lastVisibleEvent(const std::string &room_id, std::string_view event_id); RoomInfo singleRoomInfo(const std::string &room_id); @@ -160,6 +162,8 @@ getRoomInfo(const std::vector &rooms); //! Calculates which the read status of a room. //! Whether all the events in the timeline have been read. +std::string +getFullyReadEventId(const std::string &room_id); bool calculateRoomReadStatus(const std::string &room_id); void -- cgit 1.5.1