diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-12-10 11:30:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-10 11:30:19 +0100 |
commit | 162b47075a986d943dcf2cbe59799112a7ee6c9a (patch) | |
tree | 8c25adad504ad00d77df9899bed0053261b9bafc /lib/private | |
parent | 4fad9e4e6b4a03369b6a3ad49de42d893ed297e9 (diff) | |
parent | 2b581814f334b7a79ef5e7a9fb31fc421c60a57c (diff) | |
download | nextcloud-server-162b47075a986d943dcf2cbe59799112a7ee6c9a.tar.gz nextcloud-server-162b47075a986d943dcf2cbe59799112a7ee6c9a.zip |
Merge pull request #18297 from nextcloud/enh/notification_dismiss
Add interface for notification handler for dimissed events
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Notification/Manager.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php index 5d640c66be9..7791258d41a 100644 --- a/lib/private/Notification/Manager.php +++ b/lib/private/Notification/Manager.php @@ -31,6 +31,7 @@ use OCP\AppFramework\QueryException; use OCP\ILogger; use OCP\Notification\AlreadyProcessedException; use OCP\Notification\IApp; +use OCP\Notification\IDismissableNotifier; use OCP\Notification\IManager; use OCP\Notification\INotification; use OCP\Notification\INotifier; @@ -296,4 +297,18 @@ class Manager implements IManager { return $count; } + + public function dismissNotification(INotification $notification): void { + $notifiers = $this->getNotifiers(); + + foreach ($notifiers as $notifier) { + if ($notifier instanceof IDismissableNotifier) { + try { + $notifier->dismissNotification($notification); + } catch (\InvalidArgumentException $e) { + continue; + } + } + } + } } |