From 3d1c2a4acfd9b1dea8d2ef802b2877d60fe052ce Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 29 Dec 2022 04:06:21 -0700 Subject: [PATCH] Update ap inbox --- app/Util/ActivityPub/Inbox.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index f751809c9..a608899be 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -307,10 +307,20 @@ class Inbox { $activity = $this->payload['object']; $actor = $this->actorFirstOrCreate($this->payload['actor']); + + if(!$actor) { + return; + } + $status = Helpers::statusFetch($activity['inReplyTo']); + + if(!$status) { + return; + } + $poll = $status->poll; - if(!$status || !$poll) { + if(!$poll) { return; } @@ -486,9 +496,14 @@ class Inbox { $actor = $this->actorFirstOrCreate($this->payload['actor']); $target = $this->actorFirstOrCreate($this->payload['object']); - if(!$actor || $actor->domain == null || $target->domain !== null) { + if(!$actor || !$target) { return; } + + if($actor->domain == null || $target->domain !== null) { + return; + } + if( Follower::whereProfileId($actor->id) ->whereFollowingId($target->id)