mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 08:44:49 +00:00
Update SharePipeline
This commit is contained in:
parent
7e16e9d43f
commit
219362b415
1 changed files with 14 additions and 5 deletions
|
@ -19,6 +19,13 @@ class SharePipeline implements ShouldQueue
|
||||||
|
|
||||||
protected $like;
|
protected $like;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete the job if its models no longer exist.
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
public $deleteWhenMissingModels = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*
|
*
|
||||||
|
@ -45,10 +52,10 @@ class SharePipeline implements ShouldQueue
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$exists = Notification::whereProfileId($status->profile_id)
|
$exists = Notification::whereProfileId($target->id)
|
||||||
->whereActorId($actor->id)
|
->whereActorId($status->profile_id)
|
||||||
->whereAction('like')
|
->whereAction('share')
|
||||||
->whereItemId($status->id)
|
->whereItemId($status->in_reply_to_id)
|
||||||
->whereItemType('App\Status')
|
->whereItemType('App\Status')
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
|
@ -57,10 +64,12 @@ class SharePipeline implements ShouldQueue
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
$text = "{$actor->username} " . __('notification.likedPhoto');
|
||||||
|
$html = '';
|
||||||
$notification = new Notification();
|
$notification = new Notification();
|
||||||
$notification->profile_id = $status->profile_id;
|
$notification->profile_id = $status->profile_id;
|
||||||
$notification->actor_id = $actor->id;
|
$notification->actor_id = $actor->id;
|
||||||
$notification->action = 'like';
|
$notification->action = 'share';
|
||||||
$notification->message = $like->toText();
|
$notification->message = $like->toText();
|
||||||
$notification->rendered = $like->toHtml();
|
$notification->rendered = $like->toHtml();
|
||||||
$notification->item_id = $status->id;
|
$notification->item_id = $status->id;
|
||||||
|
|
Loading…
Reference in a new issue