diff --git a/lib/Service/ActivityPub/FollowService.php b/lib/Service/ActivityPub/FollowService.php index facfef67..4b716860 100644 --- a/lib/Service/ActivityPub/FollowService.php +++ b/lib/Service/ActivityPub/FollowService.php @@ -181,7 +181,6 @@ class FollowService implements ICoreService { */ public function save(ACore $follow) { /** @var Follow $follow */ - if ($follow->isRoot()) { $follow->verify($follow->getActorId()); try { diff --git a/lib/Service/ActivityPub/NoteService.php b/lib/Service/ActivityPub/NoteService.php index e143ef01..86cefa1d 100644 --- a/lib/Service/ActivityPub/NoteService.php +++ b/lib/Service/ActivityPub/NoteService.php @@ -37,6 +37,7 @@ use OCA\Social\Exceptions\ActorDoesNotExistException; use OCA\Social\Exceptions\RequestException; use OCA\Social\Exceptions\SocialAppConfigException; use OCA\Social\Model\ActivityPub\ACore; +use OCA\Social\Model\ActivityPub\Activity\Create; use OCA\Social\Model\ActivityPub\Note; use OCA\Social\Model\ActivityPub\Person; use OCA\Social\Model\InstancePath; @@ -229,7 +230,20 @@ class NoteService implements ICoreService { */ public function save(ACore $note) { /** @var Note $note */ - $this->notesRequest->save($note); + if ($note->isRoot()) { + return; + } + + $parent = $note->getParent(); + if ($parent->isRoot() === false) { + return; + } + + if ($parent->getType() === Create::TYPE) { + $parent->verify(($note->getAttributedTo())); + $this->notesRequest->save($note); + } + }