Prevent call dialogs from being presented when do not disturb is set as the user status

Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
This commit is contained in:
Claudio Cambra 2022-06-06 18:22:15 +02:00
parent d7217d1c07
commit 281e50f4cd

View file

@ -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;
}
if(systray && cfg.showCallNotifications()) {
const auto systray = Systray::instance();
if(systray) {
for(const auto &activity : list) {
systray->createCallDialog(activity);
}