forked from mirror/pixelfed
Update ap inbox
This commit is contained in:
parent
734136a7e7
commit
aad4259a47
2 changed files with 3 additions and 9 deletions
|
@ -18,15 +18,13 @@ class StatusRemoteUpdatePipeline implements ShouldQueue
|
||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
public $actor;
|
|
||||||
public $activity;
|
public $activity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*/
|
*/
|
||||||
public function __construct($actor, $activity)
|
public function __construct($activity)
|
||||||
{
|
{
|
||||||
$this->actor = $actor;
|
|
||||||
$this->activity = $activity;
|
$this->activity = $activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +34,7 @@ class StatusRemoteUpdatePipeline implements ShouldQueue
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
$activity = $this->activity;
|
$activity = $this->activity;
|
||||||
$status = Status::with('media')->whereProfileId($this->actor['id'])->whereObjectUrl($activity['id'])->first();
|
$status = Status::with('media')->whereObjectUrl($activity['id'])->first();
|
||||||
if(!$status) {
|
if(!$status) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1212,10 +1212,6 @@ class Inbox
|
||||||
public function handleUpdateActivity()
|
public function handleUpdateActivity()
|
||||||
{
|
{
|
||||||
$activity = $this->payload['object'];
|
$activity = $this->payload['object'];
|
||||||
$actor = $this->actorFirstOrCreate($this->payload['actor']);
|
|
||||||
if(!$actor || $actor->domain == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!isset($activity['type'], $activity['id'])) {
|
if(!isset($activity['type'], $activity['id'])) {
|
||||||
return;
|
return;
|
||||||
|
@ -1223,7 +1219,7 @@ class Inbox
|
||||||
|
|
||||||
if($activity['type'] === 'Note') {
|
if($activity['type'] === 'Note') {
|
||||||
if(Status::whereObjectUrl($activity['id'])->exists()) {
|
if(Status::whereObjectUrl($activity['id'])->exists()) {
|
||||||
StatusRemoteUpdatePipeline::dispatch($actor, $activity);
|
StatusRemoteUpdatePipeline::dispatch($activity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue