mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-18 11:03:17 +00:00
Add FollowPushNotifyPipeline
This commit is contained in:
parent
ae6fca4d23
commit
bd96840587
1 changed files with 38 additions and 0 deletions
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace App\Jobs\PushNotificationPipeline;
|
||||
|
||||
use App\Services\NotificationAppGatewayService;
|
||||
use Exception;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
|
||||
class FollowPushNotifyPipeline implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public $pushToken;
|
||||
|
||||
public $actor;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct($pushToken, $actor)
|
||||
{
|
||||
$this->pushToken = $pushToken;
|
||||
$this->actor = $actor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
try {
|
||||
NotificationAppGatewayService::send($this->pushToken, 'follow', $this->actor);
|
||||
} catch (Exception $e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue