diff options
| author | winter | 2025-01-23 18:55:52 +0000 |
|---|---|---|
| committer | winter | 2025-01-23 18:55:58 +0000 |
| commit | bc9c83b6c33d460a574fbeb764c23bfbe941b4c0 (patch) | |
| tree | 5d9e816b56feea462d15e391544b0b13eeb47c8d /templates/thread_page.php | |
| parent | ddccaf16f39a4bf710266edc389fcde124e7ef56 (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.php | 8 |
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 |
