From 3725c689e4f7f449b791fa51437588e87fd25dd5 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 19 Mar 2025 01:57:40 -0600 Subject: [PATCH] Update Inbox, improve Accept Follower handling --- app/Util/ActivityPub/Inbox.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index ddd377a70..7cae52c95 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -32,6 +32,7 @@ use App\Services\NotificationAppGatewayService; use App\Services\PollService; use App\Services\PushNotificationService; use App\Services\ReblogService; +use App\Services\RelationshipService; use App\Services\UserFilterService; use App\Status; use App\Story; @@ -245,7 +246,7 @@ class Inbox $cc = isset($activity['cc']) ? $activity['cc'] : []; if ($activity['type'] == 'Question') { - //$this->handlePollCreate(); + // $this->handlePollCreate(); return; } @@ -706,10 +707,20 @@ class Inbox 'profile_id' => $actor->id, 'following_id' => $target->id, ]); - FollowPipeline::dispatch($follower); - + FollowPipeline::dispatch($follower)->onQueue('high'); + RelationshipService::refresh($actor->id, $target->id); + Cache::forget('profile:following:'.$target->id); + Cache::forget('profile:followers:'.$target->id); + Cache::forget('profile:following:'.$actor->id); + Cache::forget('profile:followers:'.$actor->id); + Cache::forget('profile:follower_count:'.$target->id); + Cache::forget('profile:follower_count:'.$actor->id); + Cache::forget('profile:following_count:'.$target->id); + Cache::forget('profile:following_count:'.$actor->id); + AccountService::del($actor->id); + AccountService::del($target->id); + RelationshipService::get($actor->id, $target->id); $request->delete(); - } public function handleDeleteActivity()