aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/actor_profile_fragment.php
diff options
context:
space:
mode:
authorwinter2025-01-23 18:55:52 +0000
committerwinter2025-01-23 18:55:58 +0000
commitbc9c83b6c33d460a574fbeb764c23bfbe941b4c0 (patch)
tree5d9e816b56feea462d15e391544b0b13eeb47c8d /routes/actor_profile_fragment.php
parentddccaf16f39a4bf710266edc389fcde124e7ef56 (diff)
implement blocking users
it doesn't work yet for notifications! but i think i got it in most other places
Diffstat (limited to 'routes/actor_profile_fragment.php')
-rw-r--r--routes/actor_profile_fragment.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/routes/actor_profile_fragment.php b/routes/actor_profile_fragment.php
index 0a2a881..45f4487 100644
--- a/routes/actor_profile_fragment.php
+++ b/routes/actor_profile_fragment.php
@@ -46,6 +46,20 @@ Router::getInstance()->mount('/fragment/actor/:id/rejectPending', function (arra
render_template('actor_profile_pending_follow', ['response' => 'rejected']);
});
+Router::getInstance()->mount('/fragment/actor/:id/blockButton', function (array $args) {
+ $user = UserAccount::requireByCurrentSession();
+ $actor = Actor::find($args['id']);
+
+ if ($user->actor->blocks($actor)) {
+ // already blocking therefore unblock
+ $user->actor->unblock($actor);
+ } else {
+ $user->actor->block($actor);
+ }
+
+ render_template('actor_profile_block_button', ['user' => $user, 'actor' => $actor]);
+});
+
Router::getInstance()->mount('/fragment/profile', function (array $args) {
$user = UserAccount::requireByCurrentSession();
$actor = $user->actor;