1
0
Fork 0
forked from mirror/pixelfed

Update MovePipeline CleanupLegacyAccountMovePipeline, set moved_to_profile_id attribute on old account and clear AccountService caches accordingly

This commit is contained in:
Daniel Supernault 2024-09-11 01:31:56 -06:00
parent db84ae90f1
commit 0d8c142bf3
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -3,6 +3,8 @@
namespace App\Jobs\MovePipeline;
use App\Follower;
use App\Profile;
use App\Services\AccountService;
use App\Util\ActivityPub\Helpers;
use DateTime;
use Exception;
@ -83,5 +85,14 @@ class CleanupLegacyAccountMovePipeline implements ShouldQueue
}
Follower::whereFollowingId($actorAccount['id'])->delete();
$oldProfile = Profile::find($actorAccount['id']);
if ($oldProfile) {
$oldProfile->moved_to_profile_id = $targetAccount['id'];
$oldProfile->save();
AccountService::del($oldProfile->id);
AccountService::del($targetAccount['id']);
}
}
}