diff options
| author | winter | 2025-03-10 20:29:54 +0000 |
|---|---|---|
| committer | winter | 2025-03-10 20:29:54 +0000 |
| commit | 1685f4f0caa3c64b4919b7005950aa4ee8d4fc29 (patch) | |
| tree | 55165fdf17485db5d5e8f86c8ccc33c76bd8ecf5 /routes/actor.php | |
| parent | 30fa49bc3fa4f94184d693932e838c0672f24a16 (diff) | |
send new follow status in follow endpoint
to mitigate desynchronisation issues, which could otherwise cause one instance to think its request is pending while the other instance thinks it's active
Diffstat (limited to 'routes/actor.php')
| -rw-r--r-- | routes/actor.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/routes/actor.php b/routes/actor.php index b768413..d0bb066 100644 --- a/routes/actor.php +++ b/routes/actor.php @@ -5,6 +5,7 @@ use Digitigrade\HttpResponseStatus\PolicyRejected; use Digitigrade\HttpResponseStatus\TemporaryRedirect; use Digitigrade\HttpResponseStatus\Unauthorized; use Digitigrade\Model\Actor; +use Digitigrade\Model\FollowRelationStatus; use Digitigrade\Model\Instance; use Digitigrade\Model\Note; use Digitigrade\Model\NotePrivacyScope; @@ -84,7 +85,8 @@ Router::getInstance()->mount('/actor/:id/follow', function (array $args) { if ($initiator == null) { throw new Unauthorized('please authenticate yourself on behalf of the initiating actor'); } - $initiator->follow($target); + $newStatus = $initiator->follow($target); + echo $newStatus->value; }); Router::getInstance()->mount('/actor/:id/unfollow', function (array $args) { |
