diff options
Diffstat (limited to 'lib/Db/NotesRequest.php')
-rw-r--r-- | lib/Db/NotesRequest.php | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/lib/Db/NotesRequest.php b/lib/Db/NotesRequest.php index cc3fd342..ec9aca9f 100644 --- a/lib/Db/NotesRequest.php +++ b/lib/Db/NotesRequest.php @@ -189,10 +189,38 @@ class NotesRequest extends NotesRequestBuilder { /** - * Should returns: + * Should returns: + * * public message from actorId. + * - to followers-only if follower is logged. + * + * @param string $actorId + * @param int $since + * @param int $limit + * + * @return array + */ + public function getStreamAccount(string $actorId, int $since = 0, int $limit = 5): array { + $qb = $this->getNotesSelectSql(); + $this->limitToRecipient($qb, ActivityService::TO_PUBLIC); + $this->limitPaginate($qb, $since, $limit); + $this->limitToAttributedTo($qb, $actorId); + + $notes = []; + $cursor = $qb->execute(); + while ($data = $cursor->fetch()) { + $notes[] = $this->parseNotesSelectSql($data); + } + $cursor->closeCursor(); + + return $notes; + } + + + /** + * Should returns: * * Private message. * - group messages. - + * * @param string $actorId * @param int $since * @param int $limit |