Update ap inbox

This commit is contained in:
Daniel Supernault 2023-05-25 01:13:43 -06:00
parent 734136a7e7
commit aad4259a47
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 3 additions and 9 deletions

View file

@ -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;
} }

View file

@ -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);
} }
} }
} }