Skip to content

Commit

Permalink
Prevent call dialogs from being presented when do not disturb is set …
Browse files Browse the repository at this point in the history
…as the user status

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Jun 10, 2022
1 parent d7217d1 commit 281e50f
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 281e50f

Please sign in to comment.