From 60ea08c84605b430a78020422c949c368603de9e Mon Sep 17 00:00:00 2001 From: Charlie Date: Mon, 4 Sep 2017 21:15:10 -0700 Subject: [PATCH] Update for beta 8 --- .../pusher/src/Listener/AddClientAssets.php | 8 ++++---- .../pusher/src/Listener/AddPusherApi.php | 8 ++++---- .../pusher/src/Listener/PushNewPosts.php | 18 +++++++++--------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/extensions/pusher/src/Listener/AddClientAssets.php b/extensions/pusher/src/Listener/AddClientAssets.php index 646ef7d89..8535685bd 100644 --- a/extensions/pusher/src/Listener/AddClientAssets.php +++ b/extensions/pusher/src/Listener/AddClientAssets.php @@ -11,7 +11,7 @@ namespace Flarum\Pusher\Listener; -use Flarum\Event\ConfigureWebApp; +use Flarum\Frontend\Event\Rendering; use Illuminate\Contracts\Events\Dispatcher; class AddClientAssets @@ -21,13 +21,13 @@ class AddClientAssets */ public function subscribe(Dispatcher $events) { - $events->listen(ConfigureWebApp::class, [$this, 'addAssets']); + $events->listen(Rendering::class, [$this, 'addAssets']); } /** - * @param ConfigureClientView $event + * @param Rendering $event */ - public function addAssets(ConfigureWebApp $event) + public function addAssets(Rendering $event) { if ($event->isForum()) { $event->addAssets([ diff --git a/extensions/pusher/src/Listener/AddPusherApi.php b/extensions/pusher/src/Listener/AddPusherApi.php index ce778e91c..93a2307b4 100755 --- a/extensions/pusher/src/Listener/AddPusherApi.php +++ b/extensions/pusher/src/Listener/AddPusherApi.php @@ -11,9 +11,9 @@ namespace Flarum\Pusher\Listener; +use Flarum\Api\Event\Serializing; use Flarum\Api\Serializer\ForumSerializer; use Flarum\Event\ConfigureApiRoutes; -use Flarum\Event\PrepareApiAttributes; use Flarum\Pusher\Api\Controller\AuthController; use Flarum\Settings\SettingsRepositoryInterface; use Illuminate\Contracts\Events\Dispatcher; @@ -38,14 +38,14 @@ class AddPusherApi */ public function subscribe(Dispatcher $events) { - $events->listen(PrepareApiAttributes::class, [$this, 'addAttributes']); + $events->listen(Serializing::class, [$this, 'addAttributes']); $events->listen(ConfigureApiRoutes::class, [$this, 'addRoutes']); } /** - * @param PrepareApiAttributes $event + * @param Serializing $event */ - public function addAttributes(PrepareApiAttributes $event) + public function addAttributes(Serializing $event) { if ($event->isSerializer(ForumSerializer::class)) { $event->attributes['pusherKey'] = $this->settings->get('flarum-pusher.app_key'); diff --git a/extensions/pusher/src/Listener/PushNewPosts.php b/extensions/pusher/src/Listener/PushNewPosts.php index fa398bf48..b9111a292 100644 --- a/extensions/pusher/src/Listener/PushNewPosts.php +++ b/extensions/pusher/src/Listener/PushNewPosts.php @@ -11,10 +11,10 @@ namespace Flarum\Pusher\Listener; -use Flarum\Core\Guest; -use Flarum\Event\NotificationWillBeSent; -use Flarum\Event\PostWasPosted; +use Flarum\Notification\Event\Sending; +use Flarum\Post\Event\Posted; use Flarum\Settings\SettingsRepositoryInterface; +use Flarum\User\Guest; use Illuminate\Contracts\Events\Dispatcher; use Pusher; @@ -38,14 +38,14 @@ class PushNewPosts */ public function subscribe(Dispatcher $events) { - $events->listen(PostWasPosted::class, [$this, 'pushNewPost']); - $events->listen(NotificationWillBeSent::class, [$this, 'pushNotification']); + $events->listen(Posted::class, [$this, 'pushNewPost']); + $events->listen(Sending::class, [$this, 'pushNotification']); } /** - * @param PostWasPosted $event + * @param Posted $event */ - public function pushNewPost(PostWasPosted $event) + public function pushNewPost(Posted $event) { if ($event->post->isVisibleTo(new Guest)) { $pusher = $this->getPusher(); @@ -59,9 +59,9 @@ class PushNewPosts } /** - * @param NotificationWillBeSent $event + * @param Sending $event */ - public function pushNotification(NotificationWillBeSent $event) + public function pushNotification(Sending $event) { $pusher = $this->getPusher(); $blueprint = $event->blueprint;