From 5525369fec6fac8e41ba4e2e9eaca1c575b736ac Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 19 Mar 2025 03:00:32 -0600 Subject: [PATCH] Update Inbox handler, improve Undo Follow logic --- app/Util/ActivityPub/Inbox.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index 115c4ceb1..6621b4667 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -619,7 +619,10 @@ class Inbox Cache::forget('profile:following_count:'.$target->id); Cache::forget('profile:following_count:'.$actor->id); } - + RelationshipService::refresh($actor->id, $target->id); + AccountService::del($actor->id); + AccountService::del($target->id); + return; } public function handleAnnounceActivity() @@ -871,7 +874,7 @@ class Inbox FollowRequest::whereFollowerId($profile->id)->whereFollowingId($actor->id)->forceDelete(); RelationshipService::refresh($actor->id, $profile->id); - + return; } public function handleUndoActivity() @@ -938,6 +941,9 @@ class Inbox Follower::whereProfileId($profile->id) ->whereFollowingId($following->id) ->delete(); + FollowRequest::whereFollowingId($following->id) + ->whereFollowerId($profile->id) + ->forceDelete(); Notification::whereProfileId($following->id) ->whereActorId($profile->id) ->whereAction('follow') @@ -945,6 +951,9 @@ class Inbox ->whereItemType('App\Profile') ->forceDelete(); FollowerService::remove($profile->id, $following->id); + RelationshipService::refresh($following->id, $profile->id); + AccountService::del($profile->id); + AccountService::del($following->id); break; case 'Like':