Skip to content

Commit

Permalink
feat(priority): Send priority notifications as push during DND
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Sep 24, 2024
1 parent 1d5bcff commit 393601b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/Push.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,6 @@ class Push {
/** @var string[] */
protected $loadStatusForUsers = [];

/**
* A very small and privileged list of apps that are allowed to push during DND.
* @var bool[]
*/
protected $allowedDNDPushList = [
'twofactor_nextcloud_notification' => true,
];

public function __construct(
IDBConnection $connection,
INotificationManager $notificationManager,
Expand Down Expand Up @@ -267,7 +259,7 @@ public function pushToDevice(int $id, INotification $notification, ?OutputInterf
$userStatus = $this->userStatuses[$notification->getUser()];
if ($userStatus instanceof IUserStatus
&& $userStatus->getStatus() === IUserStatus::DND
&& empty($this->allowedDNDPushList[$notification->getApp()])) {
&& !$notification->isPriorityNotification()) {
$this->printInfo('<error>User status is set to DND - no push notifications will be sent</error>');
return;
}
Expand Down

0 comments on commit 393601b

Please sign in to comment.