+ 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/actor_profile_page.php b/templates/actor_profile_page.php
index eba9d04..3b6eb84 100644
--- a/templates/actor_profile_page.php
+++ b/templates/actor_profile_page.php
@@ -15,6 +15,8 @@ call_template('skeleton', [
$notes = Note::findAllWithAuthor($actor, 20);
if (count($notes) == 0) {
call_template('placeholder_text', ['message' => __('user.notes.placeholder')]);
+ } elseif ($user != null && $user->actor->blocks($actor)) {
+ call_template('placeholder_text', ['message' => __('user.profile.notesHidden')]);
} else {
foreach ($notes as $n) {
if ($n->isViewableBy($user))
diff --git a/templates/note_hidden.php b/templates/note_hidden.php
new file mode 100644
index 0000000..baad0d6
--- /dev/null
+++ b/templates/note_hidden.php
@@ -0,0 +1,3 @@
+
+ __('note.hidden')]); ?>
+
\ 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(),
diff --git a/templates/thread_page.php b/templates/thread_page.php
index e5e5389..d16c6aa 100644
--- a/templates/thread_page.php
+++ b/templates/thread_page.php
@@ -1,5 +1,6 @@
'"' . $note->plainContent . '" - @' . $note->author->getFullHandle(),
@@ -7,7 +8,12 @@ call_template('skeleton', [
], function () {
global $note;
$notes = Note::findAllInThread($note->threadApex ?? $note);
+ $user = UserAccount::findByCurrentSession();
foreach ($notes as $n) {
- call_template('note', ['note' => $n, 'selected' => $n == $note]);
+ if ($user != null && $user->actor->blocks($n->author)) {
+ call_template('note_hidden');
+ } else {
+ call_template('note', ['note' => $n, 'selected' => $n == $note]);
+ }
}
});
\ No newline at end of file
--
cgit v1.3