From 010debe3e4ebeff694ede05e1dab0235286a9db7 Mon Sep 17 00:00:00 2001 From: pcworld <0188801@gmail.com> Date: Sat, 29 May 2021 00:20:52 +0200 Subject: [PATCH] Fix notifications in narrow view when content is hidden In narrow view, a room can be selected even if the view currently only shows the room list and the timeline is hidden. This commit ensures that in this case, notifications are not suppressed. --- src/ChatPage.cpp | 6 ++++++ src/ChatPage.h | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index c5199ff1..1a1c1044 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -1197,6 +1197,12 @@ ChatPage::getProfileInfo() }); } +bool +ChatPage::isRoomActive(const QString &room_id) +{ + return isActiveWindow() && content_->isVisible() && currentRoom() == room_id; +} + void ChatPage::hideSideBars() { diff --git a/src/ChatPage.h b/src/ChatPage.h index 84e7cdff..a7489455 100644 --- a/src/ChatPage.h +++ b/src/ChatPage.h @@ -207,10 +207,7 @@ private: void getProfileInfo(); //! Check if the given room is currently open. - bool isRoomActive(const QString &room_id) - { - return isActiveWindow() && currentRoom() == room_id; - } + bool isRoomActive(const QString &room_id); using UserID = QString; using Membership = mtx::events::StateEvent;