diff --git a/lib/Db/FollowsRequest.php b/lib/Db/FollowsRequest.php index e3748819..8e478caf 100644 --- a/lib/Db/FollowsRequest.php +++ b/lib/Db/FollowsRequest.php @@ -61,7 +61,8 @@ class FollowsRequest extends FollowsRequestBuilder { ->setValue('actor_id', $qb->createNamedParameter($follow->getActorId())) ->setValue('type', $qb->createNamedParameter($follow->getType())) ->setValue('object_id', $qb->createNamedParameter($follow->getObjectId())) - ->setValue('follow_id', $qb->createNamedParameter($follow->getFollowId())); + ->setValue('follow_id', $qb->createNamedParameter($follow->getFollowId())) + ->setValue('accepted', $qb->createNamedParameter(($follow->isAccepted()) ? '1' : '0')); try { $qb->setValue( @@ -98,7 +99,7 @@ class FollowsRequest extends FollowsRequestBuilder { * @return Follow * @throws FollowDoesNotExistException */ - public function getByPersons(string $actorId, string $remoteActorId) { + public function getByPersons(string $actorId, string $remoteActorId): Follow { $qb = $this->getFollowsSelectSql(); $this->limitToActorId($qb, $actorId); $this->limitToObjectId($qb, $remoteActorId); diff --git a/lib/Model/ActivityPub/Object/Follow.php b/lib/Model/ActivityPub/Object/Follow.php index 382c1273..1ecf84cf 100644 --- a/lib/Model/ActivityPub/Object/Follow.php +++ b/lib/Model/ActivityPub/Object/Follow.php @@ -129,7 +129,7 @@ class Follow extends ACore implements JsonSerializable { $result = parent::jsonSerialize(); if ($this->isCompleteDetails()) { - array_merge( + $result = array_merge( $result, [ 'follow_id' => $this->getFollowId(), diff --git a/lib/Model/ActivityPub/Stream.php b/lib/Model/ActivityPub/Stream.php index 7b081148..6fdfee08 100644 --- a/lib/Model/ActivityPub/Stream.php +++ b/lib/Model/ActivityPub/Stream.php @@ -48,7 +48,7 @@ class Stream extends ACore implements JsonSerializable { /** @var string */ - private $activityId; + private $activityId = ''; /** @var string */ private $content = ''; diff --git a/lib/Service/FollowService.php b/lib/Service/FollowService.php index e41cec6d..ec4b5b67 100644 --- a/lib/Service/FollowService.php +++ b/lib/Service/FollowService.php @@ -149,8 +149,6 @@ class FollowService { $this->followsRequest->getByPersons($actor->getId(), $remoteActor->getId()); } catch (FollowDoesNotExistException $e) { $this->followsRequest->save($follow); - // TODO - Remove this auto-accepted. - $this->followsRequest->accepted($follow); $follow->addInstancePath( new InstancePath(