diff --git a/lib/Service/FollowService.php b/lib/Service/FollowService.php index c305fa71..f6a2c45c 100644 --- a/lib/Service/FollowService.php +++ b/lib/Service/FollowService.php @@ -180,6 +180,7 @@ class FollowService { * @throws RequestServerException * @throws SocialAppConfigException * @throws ItemUnknownException + * @throws UrlCloudException */ public function unfollowAccount(Person $actor, string $account) { $remoteActor = $this->cacheActorService->getFromAccount($account); @@ -188,8 +189,9 @@ class FollowService { $follow = $this->followsRequest->getByPersons($actor->getId(), $remoteActor->getId()); $this->followsRequest->delete($follow); - $undo = new Undo(); + $undo = AP::$activityPub->getItemFromType(Undo::TYPE); $follow->setParent($undo); + $undo->generateUniqueId('#undo/follows'); $undo->setObject($follow); $undo->setActorId($actor->getId());