summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorpcworld <0188801@gmail.com>2021-05-29 00:20:52 +0200
committerpcworld <0188801@gmail.com>2021-05-29 02:57:37 +0200
commit010debe3e4ebeff694ede05e1dab0235286a9db7 (patch)
treef9ba5e781c4bb4afce0f078d4006bb77f1bb9175 /src
parentTranslated using Weblate (German) (diff)
downloadnheko-010debe3e4ebeff694ede05e1dab0235286a9db7.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChatPage.cpp6
-rw-r--r--src/ChatPage.h5
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<mtx::events::state::Member>;