From b37f8067e56aa0d008cbde7377e074822b79fd51 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 9 Sep 2024 01:26:00 -0600 Subject: [PATCH] Fix typos --- .../MovePipeline/MoveMigrateFollowersPipeline.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/Jobs/MovePipeline/MoveMigrateFollowersPipeline.php b/app/Jobs/MovePipeline/MoveMigrateFollowersPipeline.php index 3dbb64844..8051d3d38 100644 --- a/app/Jobs/MovePipeline/MoveMigrateFollowersPipeline.php +++ b/app/Jobs/MovePipeline/MoveMigrateFollowersPipeline.php @@ -108,13 +108,22 @@ class MoveMigrateFollowersPipeline implements ShouldQueue ->where('followers.following_id', $actorAccount['id']) ->whereNotNull('profiles.user_id') ->whereNull('profiles.deleted_at') - ->select('profiles.id', 'profiles.user_id', 'profiles.username', 'profiles.private_key') - ->chunkById(100, function ($followers) use ($activity, $addlHeaders, $targetInbox, $targetPid) { + ->select('profiles.id', 'profiles.user_id', 'profiles.username', 'profiles.private_key', 'profiles.status') + ->chunkById(100, function ($followers) use ($addlHeaders, $targetInbox, $targetPid, $target) { $client = new Client([ 'timeout' => config('federation.activitypub.delivery.timeout'), ]); - $requests = function ($followers) use ($client, $activity, $addlHeaders, $targetInbox, $targetPid) { + $requests = function ($followers) use ($client, $target, $addlHeaders, $targetInbox, $targetPid) { + $activity = [ + '@context' => 'https://www.w3.org/ns/activitystreams', + 'type' => 'Follow', + 'actor' => null, + 'object' => $target, + ]; foreach ($followers as $follower) { + if (! $follower->private_key || ! $follower->username || ! $follower->user_id || $follower->status === 'delete') { + continue; + } $permalink = 'https://'.config('pixelfed.domain.app').'/users/'.$follower->username; $activity['actor'] = $permalink; $keyId = $permalink.'#main-key';