Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(priority): Send priority notifications as push during DND #2059

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading