diff --git a/src/Jobs/SendNotificationWhenFollowerPosted.php b/src/Jobs/SendNotificationWhenFollowerPosted.php index 559cd3d..026f10c 100755 --- a/src/Jobs/SendNotificationWhenFollowerPosted.php +++ b/src/Jobs/SendNotificationWhenFollowerPosted.php @@ -33,10 +33,9 @@ class SendNotificationWhenFollowerPosted implements ShouldQueue protected $lastPostNumber; - public function __construct(Post $post, int $lastPostNumber) + public function __construct(Post $post) { $this->post = $post; - $this->lastPostNumber = $lastPostNumber; } public function handle(NotificationSyncer $notifications) diff --git a/src/Listeners/QueueNotificationJobs.php b/src/Listeners/QueueNotificationJobs.php index ac9bee3..ab7735c 100755 --- a/src/Listeners/QueueNotificationJobs.php +++ b/src/Listeners/QueueNotificationJobs.php @@ -75,7 +75,7 @@ public function whenPostCreated(PostSaving $event) } resolve('flarum.queue.connection')->push( - new Jobs\SendNotificationWhenFollowerPosted($post, $post->discussion->last_post_number) + new Jobs\SendNotificationWhenFollowerPosted($post) ); }); } @@ -89,7 +89,7 @@ public function whenPostApproved(PostWasApproved $event) $this->queue->push( $event->post->number === 1 ? new Jobs\SendNotificationWhenDiscussionIsStarted($event->post->discussion) - : new Jobs\SendNotificationWhenFollowerPosted($event->post, $event->post->number - 1) + : new Jobs\SendNotificationWhenFollowerPosted($event->post) ); } }