aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/thread_page.php
diff options
context:
space:
mode:
authorwinter2025-01-23 18:55:52 +0000
committerwinter2025-01-23 18:55:58 +0000
commitbc9c83b6c33d460a574fbeb764c23bfbe941b4c0 (patch)
tree5d9e816b56feea462d15e391544b0b13eeb47c8d /templates/thread_page.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 'templates/thread_page.php')
-rw-r--r--templates/thread_page.php8
1 files changed, 7 insertions, 1 deletions
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 @@
<?php
use Digitigrade\Model\Note;
+use Digitigrade\Model\UserAccount;
call_template('skeleton', [
'pageTitle' => '"' . $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