From cc7cdfdd5fa49abffb5fd0e852db66bf6fe2cf14 Mon Sep 17 00:00:00 2001 From: winter Date: Thu, 23 Jan 2025 18:55:52 +0000 Subject: implement blocking users it doesn't work yet for notifications! but i think i got it in most other places --- templates/actor_profile.php | 4 +++- templates/actor_profile_block_button.php | 7 +++++++ templates/notifications_panel.php | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 templates/actor_profile_block_button.php (limited to 'templates') diff --git a/templates/actor_profile.php b/templates/actor_profile.php index 2947a72..cfcc510 100644 --- a/templates/actor_profile.php +++ b/templates/actor_profile.php @@ -17,7 +17,9 @@ $user = UserAccount::findByCurrentSession();
@getFullHandle() ?>
created->format('Y-m-d')) ?>
-
+
+ actor != $actor) + call_template('actor_profile_block_button', ['actor' => $actor, 'user' => $user]); ?> isLocal): ?> diff --git a/templates/actor_profile_block_button.php b/templates/actor_profile_block_button.php new file mode 100644 index 0000000..f82cc9a --- /dev/null +++ b/templates/actor_profile_block_button.php @@ -0,0 +1,7 @@ +actor->blocks($actor); +$action = $blocks ? 'unblock' : 'block'; +?> + \ No newline at end of file diff --git a/templates/notifications_panel.php b/templates/notifications_panel.php index 3ca8faf..98a04e3 100644 --- a/templates/notifications_panel.php +++ b/templates/notifications_panel.php @@ -13,6 +13,8 @@ $notifications = Notification::findAllForUser($user, 50); } foreach ($notifications as $notif) { $notif = $notif->toNotifyable(); + if ($notif == null) + continue; call_template('notification', [ 'title' => $notif->getNotificationTitle(), 'body' => $notif->getNotificationBody(), -- cgit v1.3