From 281e50f4cd66e361ca5d56f46f056b4444dde81b Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 6 Jun 2022 18:22:15 +0200 Subject: [PATCH] Prevent call dialogs from being presented when do not disturb is set as the user status Signed-off-by: Claudio Cambra --- src/gui/tray/usermodel.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index 5907f00d5da47..f02a2f8c71ac2 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -130,10 +130,18 @@ void User::slotBuildNotificationDisplay(const ActivityList &list) void User::slotBuildIncomingCallDialogs(const ActivityList &list) { - const auto systray = Systray::instance(); const ConfigFile cfg; + const auto userStatus = _account->account()->userStatusConnector()->userStatus().state(); + if (userStatus == OCC::UserStatus::OnlineStatus::DoNotDisturb || + !cfg.optionalServerNotifications() || + !cfg.showCallNotifications() || + !isDesktopNotificationsAllowed()) { + return; + } + + const auto systray = Systray::instance(); - if(systray && cfg.showCallNotifications()) { + if(systray) { for(const auto &activity : list) { systray->createCallDialog(activity); }