aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/actor.php
diff options
context:
space:
mode:
Diffstat (limited to 'routes/actor.php')
-rw-r--r--routes/actor.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/routes/actor.php b/routes/actor.php
index 98e8f4e..65a3837 100644
--- a/routes/actor.php
+++ b/routes/actor.php
@@ -68,4 +68,28 @@ Router::getInstance()->mount('/user/:handle/unfollow', function (array $args) {
throw new Unauthorized('please authenticate yourself on behalf of the initiating actor');
}
$initiator->unfollow($target);
+});
+
+Router::getInstance()->mount('/user/:handle/acceptedFollow', function (array $args) {
+ $initiator = Actor::findLocalByHandle($args['handle']);
+ if ($initiator == null) {
+ throw new NotFound();
+ }
+ $target = Actor::findByRequestHeaders();
+ if ($target == null) {
+ throw new Unauthorized('please authenticate yourself on behalf of the followed actor');
+ }
+ $target->acceptPendingFollowFrom($initiator);
+});
+
+Router::getInstance()->mount('/user/:handle/rejectedFollow', function (array $args) {
+ $initiator = Actor::findLocalByHandle($args['handle']);
+ if ($initiator == null) {
+ throw new NotFound();
+ }
+ $target = Actor::findByRequestHeaders();
+ if ($target == null) {
+ throw new Unauthorized('please authenticate yourself on behalf of the followed actor');
+ }
+ $target->rejectPendingFollowFrom($initiator);
}); \ No newline at end of file