From 5aff3e43098f1e730afe0202c737a93e90346c9b Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Mon, 7 May 2018 12:00:49 +0300 Subject: Don't send notification for the room that is currently open --- include/ChatPage.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/ChatPage.h') diff --git a/include/ChatPage.h b/include/ChatPage.h index f659163c..6e0cf2d9 100644 --- a/include/ChatPage.h +++ b/include/ChatPage.h @@ -117,6 +117,12 @@ private slots: private: static ChatPage *instance_; + //! Check if the given room is currently open. + bool isRoomActive(const QString &room_id) + { + return isActiveWindow() && currentRoom() == room_id; + } + using UserID = QString; using Membership = mtx::events::StateEvent; using Memberships = std::map; -- cgit 1.5.1