From: Dan Brown Date: Wed, 19 Jul 2023 10:03:05 +0000 (+0100) Subject: Notifications: Started activity->notification core framework X-Git-Tag: v23.08~1^2~13^2~19 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/45e75edf0544217e1a46f5628037770a6713b23b Notifications: Started activity->notification core framework --- diff --git a/app/Activity/Notifications/Handlers/CommentCreationNotificationHandler.php b/app/Activity/Notifications/Handlers/CommentCreationNotificationHandler.php new file mode 100644 index 000000000..5f2e1c770 --- /dev/null +++ b/app/Activity/Notifications/Handlers/CommentCreationNotificationHandler.php @@ -0,0 +1,13 @@ +notifications->loadDefaultHandlers(); + } + /** * Add a generic activity event to the database. */ - public function add(string $type, $detail = '') + public function add(string $type, string|Loggable $detail = ''): void { $detailToStore = ($detail instanceof Loggable) ? $detail->logDescriptor() : $detail; @@ -34,6 +40,7 @@ class ActivityLogger $this->setNotification($type); $this->dispatchWebhooks($type, $detail); + $this->notifications->handle($type, $detail); Theme::dispatch(ThemeEvents::ACTIVITY_LOGGED, $type, $detail); }