mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-18 11:03:17 +00:00
Update MovePipeline CleanupLegacyAccountMovePipeline, set moved_to_profile_id attribute on old account and clear AccountService caches accordingly
This commit is contained in:
parent
db84ae90f1
commit
0d8c142bf3
1 changed files with 11 additions and 0 deletions
|
@ -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']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue