From 393601bf21363c9682855cb0f70e4a4ac62c3c6d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 20 Sep 2024 13:09:25 +0200 Subject: [PATCH] feat(priority): Send priority notifications as push during DND Signed-off-by: Joas Schilling --- lib/Push.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/Push.php b/lib/Push.php index fa296c51..bac335ee 100644 --- a/lib/Push.php +++ b/lib/Push.php @@ -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, @@ -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('User status is set to DND - no push notifications will be sent'); return; }