Skip to content
Closed
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
implement IDismissableNotifier interface to react to notification dis…
…miss

Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Oct 13, 2022
commit 752140ac006712ef75befdc383137025563bf991
14 changes: 13 additions & 1 deletion lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\L10N\IFactory;
use OCP\Notification\IDismissableNotifier;
use OCP\Notification\IManager as INotificationManager;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
use OCA\OpenProject\AppInfo\Application;

class Notifier implements INotifier {
class Notifier implements INotifier, IDismissableNotifier {

/** @var IFactory */
protected $factory;
Expand Down Expand Up @@ -114,4 +115,15 @@ public function prepare(INotification $notification, string $languageCode): INot
throw new InvalidArgumentException();
}
}

/**
* @inheritDoc
*/
public function dismissNotification(INotification $notification): void {
if ($notification->getApp() !== Application::APP_ID) {
throw new \InvalidArgumentException('Unhandled app');
}

// do some stuff ^^
}
}