aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/actor.php18
-rw-r--r--routes/actor_profile.php (renamed from routes/user.php)2
-rw-r--r--routes/homepage.php2
-rw-r--r--routes/note.php4
-rw-r--r--routes/webfinger.php2
5 files changed, 14 insertions, 14 deletions
diff --git a/routes/actor.php b/routes/actor.php
index 8ebf1e2..d453a11 100644
--- a/routes/actor.php
+++ b/routes/actor.php
@@ -7,18 +7,18 @@ use Digitigrade\Model\Actor;
use Digitigrade\Model\Note;
use Digitigrade\Router;
-Router::getInstance()->mount('/user/:handle', function (array $args) {
+Router::getInstance()->mount('/actor/:handle', function (array $args) {
$actor = Actor::findLocalByHandle($args['handle']);
if ($actor == null || $actor->deleted) {
- throw new NotFound("i don't know any local user called " . $args['handle']);
+ throw new NotFound("i don't know any local actor called " . $args['handle']);
}
if (isset($_SERVER['HTTP_ACCEPT']) && str_contains($_SERVER['HTTP_ACCEPT'], 'text/html')) {
- throw new TemporaryRedirect(path_to_uri("/@/$actor->handle"));
+ throw new TemporaryRedirect("/@/$actor->handle");
}
json_response($actor);
});
-Router::getInstance()->mount('/user/:handle/basicFeed', function (array $args) {
+Router::getInstance()->mount('/actor/:handle/basicFeed', function (array $args) {
$actor = Actor::findLocalByHandle($args['handle']);
$notes = Note::findAllWithAuthor($actor);
// TODO: implement pagination
@@ -33,7 +33,7 @@ Router::getInstance()->mount('/user/:handle/basicFeed', function (array $args) {
]);
});
-Router::getInstance()->mount('/user/:handle/fullFeed', function (array $args) {
+Router::getInstance()->mount('/actor/:handle/fullFeed', function (array $args) {
$actor = Actor::findLocalByHandle($args['handle']);
$notes = Note::findAllWithAuthor($actor);
// TODO: implement pagination here as well
@@ -46,7 +46,7 @@ Router::getInstance()->mount('/user/:handle/fullFeed', function (array $args) {
]);
});
-Router::getInstance()->mount('/user/:handle/follow', function (array $args) {
+Router::getInstance()->mount('/actor/:handle/follow', function (array $args) {
$target = Actor::findLocalByHandle($args['handle']);
if ($target == null) {
throw new NotFound();
@@ -58,7 +58,7 @@ Router::getInstance()->mount('/user/:handle/follow', function (array $args) {
$initiator->follow($target);
});
-Router::getInstance()->mount('/user/:handle/unfollow', function (array $args) {
+Router::getInstance()->mount('/actor/:handle/unfollow', function (array $args) {
$target = Actor::findLocalByHandle($args['handle']);
if ($target == null) {
throw new NotFound();
@@ -70,7 +70,7 @@ Router::getInstance()->mount('/user/:handle/unfollow', function (array $args) {
$initiator->unfollow($target);
});
-Router::getInstance()->mount('/user/:handle/acceptedFollow', function (array $args) {
+Router::getInstance()->mount('/actor/:handle/acceptedFollow', function (array $args) {
$initiator = Actor::findLocalByHandle($args['handle']);
if ($initiator == null) {
throw new NotFound();
@@ -82,7 +82,7 @@ Router::getInstance()->mount('/user/:handle/acceptedFollow', function (array $ar
$target->acceptPendingFollowFrom($initiator);
});
-Router::getInstance()->mount('/user/:handle/rejectedFollow', function (array $args) {
+Router::getInstance()->mount('/actor/:handle/rejectedFollow', function (array $args) {
$initiator = Actor::findLocalByHandle($args['handle']);
if ($initiator == null) {
throw new NotFound();
diff --git a/routes/user.php b/routes/actor_profile.php
index c0a632a..4fea967 100644
--- a/routes/user.php
+++ b/routes/actor_profile.php
@@ -13,7 +13,7 @@ Router::getInstance()->mount('/@/:handle', function (array $args) {
$actor = Actor::findLocalByHandle($args['handle']);
}
if ($actor == null || $actor->deleted) {
- throw new NotFound("i don't know any user called " . $args['handle']);
+ throw new NotFound("i don't know any actor called " . $args['handle']);
}
render_template('actor_profile_page', ['actor' => $actor]);
}); \ No newline at end of file
diff --git a/routes/homepage.php b/routes/homepage.php
index 94fe4c9..c147d67 100644
--- a/routes/homepage.php
+++ b/routes/homepage.php
@@ -6,7 +6,7 @@ use Digitigrade\Router;
Router::getInstance()->mount('/', function (array $args) {
if (str_contains($_SERVER['HTTP_ACCEPT'] ?? '', 'text/html')) {
- throw new TemporaryRedirect(path_to_uri('/feed/global'));
+ throw new TemporaryRedirect('/feed/global');
}
throw new NotFound();
}); \ No newline at end of file
diff --git a/routes/note.php b/routes/note.php
index 4e0f867..071c86c 100644
--- a/routes/note.php
+++ b/routes/note.php
@@ -4,13 +4,13 @@ use Digitigrade\HttpResponseStatus\NotFound;
use Digitigrade\Model\Note;
use Digitigrade\Router;
-Router::getInstance()->mount('/post/:id', function (array $args) {
+Router::getInstance()->mount('/note/:id', function (array $args) {
$note = Note::find($args['id']);
if ($note == null || $note->deleted) {
throw new NotFound("i don't know that note");
}
if (!$note->author->isLocal) {
- throw new NotFound("i don't want to tell you about non local posts sorry");
+ throw new NotFound("i don't want to tell you about non local notes sorry");
}
json_response($note);
});
diff --git a/routes/webfinger.php b/routes/webfinger.php
index 541fb06..1b719cd 100644
--- a/routes/webfinger.php
+++ b/routes/webfinger.php
@@ -29,7 +29,7 @@ Router::getInstance()->mount('/.well-known/webfinger', function (array $args) {
'links' => [
[
'rel' => ActorWebfinger::REL_URI,
- 'href' => path_to_uri("/user/$actor->handle"),
+ 'href' => path_to_uri("/actor/$actor->handle"),
'type' => 'application/json'
]
]