diff --git a/app/Jobs/MovePipeline/MoveMigrateFollowersPipeline.php b/app/Jobs/MovePipeline/MoveMigrateFollowersPipeline.php index 021cae1e0..1f4ae59cb 100644 --- a/app/Jobs/MovePipeline/MoveMigrateFollowersPipeline.php +++ b/app/Jobs/MovePipeline/MoveMigrateFollowersPipeline.php @@ -3,6 +3,8 @@ namespace App\Jobs\MovePipeline; use App\Follower; +use App\Http\Controllers\FollowerController; +use App\Profile; use App\Util\ActivityPub\Helpers; use DateTime; use DB; @@ -118,8 +120,10 @@ class MoveMigrateFollowersPipeline implements ShouldQueue if (! $follower->private_key || ! $follower->username || ! $follower->user_id || $follower->status === 'delete') { continue; } + if ($targetInbox) { - MoveSendFollowPipeline::dispatch($follower, $targetInbox, $targetPid, $target)->onQueue('follow'); + $followerProfile = Profile::find($follower->id); + (new FollowerController)->sendFollow($followerProfile, $targetAccount); } else { Follower::updateOrCreate([ 'profile_id' => $follower->id, diff --git a/app/Jobs/ProfilePipeline/ProfileMigrationMoveFollowersPipeline.php b/app/Jobs/ProfilePipeline/ProfileMigrationMoveFollowersPipeline.php index 4b64a3039..137dc61b8 100644 --- a/app/Jobs/ProfilePipeline/ProfileMigrationMoveFollowersPipeline.php +++ b/app/Jobs/ProfilePipeline/ProfileMigrationMoveFollowersPipeline.php @@ -81,21 +81,16 @@ class ProfileMigrationMoveFollowersPipeline implements ShouldBeUniqueUntilProces } $targetInbox = $ne['sharedInbox'] ?? $ne['inbox_url']; - foreach (Follower::whereFollowingId($this->oldPid)->where('local_profile', true)->lazyById(200, 'id') as $follower) { + foreach (Follower::whereFollowingId($this->oldPid)->lazyById(200, 'id') as $follower) { try { - if ($targetInbox) { + if ($targetInbox && $follower->local_profile) { $followerProfile = Profile::find($follower->profile_id); - Follower::updateOrCreate([ - 'profile_id' => $follower->profile_id, - 'following_id' => $this->newPid, - ]); (new FollowerController)->sendFollow($followerProfile, $ne); - } else { - Follower::updateOrCreate([ - 'profile_id' => $follower->profile_id, - 'following_id' => $this->newPid, - ]); } + Follower::updateOrCreate([ + 'profile_id' => $follower->profile_id, + 'following_id' => $this->newPid, + ]); } catch (Exception $e) { Log::error($e); }