From 0d8c142bf31a0de5fe5cc5f71566145606c2fc91 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 11 Sep 2024 01:31:56 -0600 Subject: [PATCH] Update MovePipeline CleanupLegacyAccountMovePipeline, set moved_to_profile_id attribute on old account and clear AccountService caches accordingly --- .../MovePipeline/CleanupLegacyAccountMovePipeline.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Jobs/MovePipeline/CleanupLegacyAccountMovePipeline.php b/app/Jobs/MovePipeline/CleanupLegacyAccountMovePipeline.php index 8e06c58e1..bcf283afc 100644 --- a/app/Jobs/MovePipeline/CleanupLegacyAccountMovePipeline.php +++ b/app/Jobs/MovePipeline/CleanupLegacyAccountMovePipeline.php @@ -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']); + } } }