aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes
diff options
context:
space:
mode:
authorwinter2025-03-31 22:01:50 +0100
committerwinter2025-03-31 22:01:50 +0100
commitdc1deda3a02e3ebc31d4ed3a256580469cf83c0e (patch)
tree12bfd47830aa06e09d24ce5276bff7cfac21ef94 /routes
parenta9f0003e809d46093e783d2079be7a952b5f5e0d (diff)
add button to reload actors from remote instance
Diffstat (limited to 'routes')
-rw-r--r--routes/actor_profile.php2
-rw-r--r--routes/actor_profile_fragment.php6
2 files changed, 6 insertions, 2 deletions
diff --git a/routes/actor_profile.php b/routes/actor_profile.php
index 2f297b9..4a197ee 100644
--- a/routes/actor_profile.php
+++ b/routes/actor_profile.php
@@ -7,7 +7,7 @@ use Digitigrade\Router;
Router::getInstance()->mount('/@/:handle', function (array $args) {
if (str_contains($args['handle'], '@')) {
// remote actor
- $actor = Actor::findByWebfinger($args['handle']);
+ $actor = Actor::findByWebfinger($args['handle'], forceRefetch: isset($_GET['forceRefetch']));
} else {
// local actor
$actor = Actor::findLocalByHandle($args['handle']);
diff --git a/routes/actor_profile_fragment.php b/routes/actor_profile_fragment.php
index debead0..b93556a 100644
--- a/routes/actor_profile_fragment.php
+++ b/routes/actor_profile_fragment.php
@@ -11,7 +11,11 @@ use Digitigrade\Router;
use Digitigrade\StorageProvider\FilesystemStorage;
Router::getInstance()->mount('/fragment/actor/:id', function (array $args) {
- render_template('actor/profile', ['actor' => Actor::find($args['id'])]);
+ $actor = Actor::find($args['id']);
+ if (isset($_GET['forceRefetch'])) {
+ $actor = Actor::findByUri($actor->uri, forceRefetch: true);
+ }
+ render_template('actor/profile', ['actor' => $actor]);
});
Router::getInstance()->mount('/fragment/actor/:id/followButton', function (array $args) {