diff options
Diffstat (limited to 'Digitigrade/Model/Note.php')
| -rw-r--r-- | Digitigrade/Model/Note.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Digitigrade/Model/Note.php b/Digitigrade/Model/Note.php index 277b503..a4891a3 100644 --- a/Digitigrade/Model/Note.php +++ b/Digitigrade/Model/Note.php @@ -112,6 +112,8 @@ class Note extends PushableModel implements TimelineIncludeable { } public static function findAllInThread(Note $threadApex, ?int $limit = null, int $offset = 0): array { + if (isset($limit)) + $limit--; // to account for adding the note afterwards $notes = self::findAllWhere('thread_apex = ? AND deleted = false', [$threadApex->id], $limit, $offset, 'created ASC'); array_splice($notes, 0, 0, [$threadApex]); // since the apex itself has threadApex = null return $notes; |
