diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-12-09 13:19:45 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-12-10 10:02:24 +0100 |
commit | 2b581814f334b7a79ef5e7a9fb31fc421c60a57c (patch) | |
tree | 7ff23c680541f1a9416457b1daaedae3b1aac3f8 /lib/private | |
parent | 3e720942e58f99b038616d95e00a01ac9dd2f490 (diff) | |
download | nextcloud-server-2b581814f334b7a79ef5e7a9fb31fc421c60a57c.tar.gz nextcloud-server-2b581814f334b7a79ef5e7a9fb31fc421c60a57c.zip |
Add interface for notification handler for dimissed events
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
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; + } + } + } + } } |