Skip to content

Commit

Permalink
Merge pull request #4611 from nextcloud/bugfix/dnd-call
Browse files Browse the repository at this point in the history
Prevent call dialogs from being presented when do not disturb is set as the user status
  • Loading branch information
claucambra authored Jun 10, 2022
2 parents d7217d1 + 281e50f commit 90a2f12
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 90a2f12

Please sign in to comment.