diff --git a/extensions/akismet/src/Listener/AddClientAssets.php b/extensions/akismet/src/Listener/AddClientAssets.php index ec4fa8d87..deba73a9e 100644 --- a/extensions/akismet/src/Listener/AddClientAssets.php +++ b/extensions/akismet/src/Listener/AddClientAssets.php @@ -11,7 +11,7 @@ namespace Flarum\Akismet\Listener; -use Flarum\Event\ConfigureWebApp; +use Flarum\Frontend\Event\Rendering; use Illuminate\Contracts\Events\Dispatcher; class AddClientAssets @@ -21,13 +21,11 @@ class AddClientAssets */ public function subscribe(Dispatcher $events) { - $events->listen(ConfigureWebApp::class, [$this, 'addAssets']); + $events->listen(Rendering::class, [$this, 'addAssets']); + } - /** - * @param ConfigureClientView $event - */ - public function addAssets(ConfigureWebApp $event) + public function addAssets(Rendering $event) { if ($event->isForum()) { $event->addAssets([ diff --git a/extensions/akismet/src/Listener/FilterNewPosts.php b/extensions/akismet/src/Listener/FilterNewPosts.php index 237ce4b9a..e6b6c1d01 100644 --- a/extensions/akismet/src/Listener/FilterNewPosts.php +++ b/extensions/akismet/src/Listener/FilterNewPosts.php @@ -12,10 +12,10 @@ namespace Flarum\Akismet\Listener; use Flarum\Approval\Event\PostWasApproved; -use Flarum\Event\PostWasHidden; -use Flarum\Event\PostWillBeSaved; use Flarum\Flags\Flag; use Flarum\Foundation\Application; +use Flarum\Post\Event\Hidden; +use Flarum\Post\Event\Saving; use Flarum\Settings\SettingsRepositoryInterface; use Illuminate\Contracts\Events\Dispatcher; use TijsVerkoyen\Akismet\Akismet; @@ -47,15 +47,15 @@ class FilterNewPosts */ public function subscribe(Dispatcher $events) { - $events->listen(PostWillBeSaved::class, [$this, 'validatePost']); + $events->listen(Saving::class, [$this, 'validatePost']); $events->listen(PostWasApproved::class, [$this, 'submitHam']); - $events->listen(PostWasHidden::class, [$this, 'submitSpam']); + $events->listen(Hidden::class, [$this, 'submitSpam']); } /** - * @param PostWillBeSaved $event + * @param Saving $event */ - public function validatePost(PostWillBeSaved $event) + public function validatePost(Saving $event) { $post = $event->post; @@ -111,9 +111,9 @@ class FilterNewPosts } /** - * @param PostWasHidden $event + * @param Hidden $event */ - public function submitSpam(PostWasHidden $event) + public function submitSpam(Hidden $event) { $post = $event->post;