Only notify talk chat notifications if this is enabled
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 13 Feb 2023 13:15:18 +0000 (14:15 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 21 Nov 2024 11:31:23 +0000 (12:31 +0100)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/tray/usermodel.cpp

index 98393f4ca9406294b5d03bac7ed7ae71563240c6..fefbe27f46c2b6a5f24800e312c8b355041dce54 100644 (file)
@@ -184,7 +184,12 @@ void User::showDesktopTalkNotification(const Activity &activity)
 {
     const auto notificationId = activity._id;
 
-    if (!canShowNotification(notificationId)) {
+    const ConfigFile cfg;
+    const auto userStatus = _account->account()->userStatusConnector()->userStatus().state();
+    if (!canShowNotification(notificationId) ||
+        userStatus == OCC::UserStatus::OnlineStatus::DoNotDisturb ||
+        !cfg.showChatNotifications()) {
+
         return;
     }