From aafbcc8fc1a07872fffa4d669117f41148e509a8 Mon Sep 17 00:00:00 2001 From: winter Date: Mon, 23 Dec 2024 22:26:46 +0000 Subject: rename "user" to actor and "post" to note everywhere --- routes/actor_profile.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 routes/actor_profile.php (limited to 'routes/actor_profile.php') diff --git a/routes/actor_profile.php b/routes/actor_profile.php new file mode 100644 index 0000000..4fea967 --- /dev/null +++ b/routes/actor_profile.php @@ -0,0 +1,19 @@ +mount('/@/:handle', function (array $args) { + if (str_contains($args['handle'], '@')) { + // remote actor + $actor = Actor::findByWebfinger($args['handle']); + } else { + // local actor + $actor = Actor::findLocalByHandle($args['handle']); + } + if ($actor == null || $actor->deleted) { + 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 -- cgit v1.3