More precise

pull/6194/head
Emily Love Watson 1 month ago
parent 7709d5da29
commit e645008ad5
No known key found for this signature in database
GPG Key ID: 69981387DE7BC2EE

@ -114,7 +114,7 @@ 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', 'profiles.status')
->select('profiles.id', 'profiles.user_id', 'profiles.username', 'profiles.private_key', 'profiles.status', 'followers.local_profile')
->chunkById(100, function ($followers) use ($targetInbox, $targetPid, $targetAccount) {
foreach ($followers as $follower) {
if (! $follower->private_key || ! $follower->username || ! $follower->user_id || $follower->status === 'delete') {
@ -125,7 +125,11 @@ class MoveMigrateFollowersPipeline implements ShouldQueue
'profile_id' => $follower->id,
'following_id' => $targetPid,
]);
if ($targetInbox) {
// If the remote user has migrated to a different instance,
// send a follow request for each local follower to the new
// instance
if ($targetInbox && $follower->local_profile) {
$followerProfile = Profile::find($follower->id);
(new FollowerController)->sendFollow($followerProfile, $targetAccount);
}

@ -89,6 +89,9 @@ class ProfileMigrationMoveFollowersPipeline implements ShouldBeUniqueUntilProces
try {
$follower->following_id = $this->newPid;
$follower->save();
// If a local user has migrated to a different instance, send a
// follow request for each local follower to the new instance
if ($targetInbox && $follower->local_profile) {
$followerProfile = Profile::find($follower->profile_id);
(new FollowerController)->sendFollow($followerProfile, $ne);

Loading…
Cancel
Save