diff options
| author | winter | 2024-12-24 15:32:56 +0000 |
|---|---|---|
| committer | winter | 2024-12-24 15:32:56 +0000 |
| commit | d5a57276eb27e215dd0b1bd5eb67ac26acc9575b (patch) | |
| tree | 0cb3a14fa9a82d2438a7c12838f04ea12e02a9fa /Digitigrade | |
| parent | 01b7c47c68b8b3c5a9fd9137b067b34b566b951d (diff) | |
more stuff and things
Diffstat (limited to 'Digitigrade')
| -rw-r--r-- | Digitigrade/Model/Note.php | 8 | ||||
| -rw-r--r-- | Digitigrade/Timeline/GlobalTimeline.php | 2 | ||||
| -rw-r--r-- | Digitigrade/Timeline/LocalTimeline.php | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/Digitigrade/Model/Note.php b/Digitigrade/Model/Note.php index 3c0c690..bc8b39b 100644 --- a/Digitigrade/Model/Note.php +++ b/Digitigrade/Model/Note.php @@ -102,8 +102,12 @@ class Note extends PushableModel { return $actors; } - public static function findAllWithAuthor(Actor $author, ?int $limit = null, int $offset = 0): array { - return self::findAllWhere('author = ?', [$author->id], $limit, $offset, 'created DESC'); + public static function findAllWithAuthor(Actor $author, ?int $limit = null, int $offset = 0, bool $includeDeleted = false): array { + $where = 'author = ?'; + if (!$includeDeleted) { + $where .= ' AND deleted = false'; + } + return self::findAllWhere($where, [$author->id], $limit, $offset, 'created DESC'); } public function getInteractions(): array { diff --git a/Digitigrade/Timeline/GlobalTimeline.php b/Digitigrade/Timeline/GlobalTimeline.php index b495174..2236ee4 100644 --- a/Digitigrade/Timeline/GlobalTimeline.php +++ b/Digitigrade/Timeline/GlobalTimeline.php @@ -9,7 +9,7 @@ class GlobalTimeline extends Timeline { $db = Db::getInstance()->getPdo(); $stmt = $db->prepare(<<<END SELECT note.id FROM note LEFT JOIN note_privacy ON note_privacy.note_id = note.id - WHERE note_privacy.scope = 'public' AND note_privacy.indexable = true + WHERE note_privacy.scope = 'public' AND note_privacy.indexable = true AND note.deleted = false ORDER BY note.created DESC LIMIT ? OFFSET ? END); $stmt->execute([$limit, $offset]); diff --git a/Digitigrade/Timeline/LocalTimeline.php b/Digitigrade/Timeline/LocalTimeline.php index e4594af..69b8634 100644 --- a/Digitigrade/Timeline/LocalTimeline.php +++ b/Digitigrade/Timeline/LocalTimeline.php @@ -11,7 +11,7 @@ class LocalTimeline extends Timeline { SELECT note.id FROM note LEFT JOIN note_privacy ON note_privacy.note_id = note.id LEFT JOIN actor ON note.author = actor.id - WHERE note_privacy.scope = 'public' AND note_privacy.indexable = true AND actor.is_local = true + WHERE note_privacy.scope = 'public' AND note_privacy.indexable = true AND actor.is_local = true AND note.deleted = false ORDER BY note.created DESC LIMIT ? OFFSET ? END); $stmt->execute([$limit, $offset]); |
