From: Claudio Cambra Date: Mon, 6 Jun 2022 16:22:15 +0000 (+0200) Subject: Prevent call dialogs from being presented when do not disturb is set as the user... X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~15^2~165^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=281e50f4cd66e361ca5d56f46f056b4444dde81b;p=nextcloud-desktop.git Prevent call dialogs from being presented when do not disturb is set as the user status Signed-off-by: Claudio Cambra --- diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index 5907f00d5..f02a2f8c7 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); }