sforkowany z mirror/social
get public messages from an account
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>alpha1
rodzic
6af499a817
commit
61a28c2171
|
@ -68,6 +68,7 @@ return [
|
|||
['name' => 'Local#streamTimeline', 'url' => '/api/v1/stream/timeline', 'verb' => 'GET'],
|
||||
['name' => 'Local#streamFederated', 'url' => '/api/v1/stream/federated', 'verb' => 'GET'],
|
||||
['name' => 'Local#streamDirect', 'url' => '/api/v1/stream/direct', 'verb' => 'GET'],
|
||||
['name' => 'Local#streamAccount', 'url' => '/api/v1/account/{username}/stream', 'verb' => 'GET'],
|
||||
|
||||
['name' => 'Local#postCreate', 'url' => '/api/v1/post', 'verb' => 'POST'],
|
||||
['name' => 'Local#postDelete', 'url' => '/api/v1/post', 'verb' => 'DELETE'],
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -370,7 +370,7 @@ class NoteService implements ICoreService {
|
|||
* @return Note[]
|
||||
*/
|
||||
public function getStreamAccount(string $actorId, int $since = 0, int $limit = 5): array {
|
||||
return $this->notesRequest->getStreamHome($actorId, $since, $limit);
|
||||
return $this->notesRequest->getStreamAccount($actorId, $since, $limit);
|
||||
}
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue