add action field to everyone stream

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/462/head
Maxence Lange 2019-04-22 07:37:20 -01:00
rodzic e70f67cea9
commit 0f416c588b
2 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -325,7 +325,6 @@ class LocalController extends Controller {
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* @param int $since
* @param int $limit
@ -334,7 +333,7 @@ class LocalController extends Controller {
*/
public function streamDirect(int $since = 0, int $limit = 5): DataResponse {
try {
$this->initViewer();
$this->initViewer(true);
$posts = $this->noteService->getStreamDirect($this->viewer, $since, $limit);
return $this->success($posts);
@ -348,6 +347,7 @@ class LocalController extends Controller {
* Get timeline
*
* @NoAdminRequired
* @NoCSRFRequired
*
* @param int $since
* @param int $limit
@ -356,6 +356,7 @@ class LocalController extends Controller {
*/
public function streamTimeline(int $since = 0, int $limit = 5): DataResponse {
try {
$this->initViewer(true);
$posts = $this->noteService->getStreamLocalTimeline($since, $limit);
return $this->success($posts);

Wyświetl plik

@ -263,6 +263,7 @@ class NotesRequest extends NotesRequestBuilder {
$this->limitPaginate($qb, $since, $limit);
$this->limitToRecipient($qb, $actor->getId(), false);
$this->leftJoinCacheActors($qb, 'attributed_to');
$this->leftJoinStreamAction($qb);
$notes = [];
$cursor = $qb->execute();
@ -293,6 +294,7 @@ class NotesRequest extends NotesRequestBuilder {
$this->limitToAttributedTo($qb, $actorId);
$this->leftJoinCacheActors($qb, 'attributed_to');
$this->limitToRecipient($qb, ACore::CONTEXT_PUBLIC);
$this->leftJoinStreamAction($qb);
$notes = [];
$cursor = $qb->execute();
@ -357,6 +359,8 @@ class NotesRequest extends NotesRequestBuilder {
$this->limitToLocal($qb, true);
}
$this->leftJoinCacheActors($qb, 'attributed_to');
$this->leftJoinStreamAction($qb);
// TODO: to: = real public, cc: = unlisted !?
$this->limitToRecipient($qb, ACore::CONTEXT_PUBLIC, true, ['to']);
@ -398,6 +402,7 @@ class NotesRequest extends NotesRequestBuilder {
$this->limitPaginate($qb, $since, $limit);
$this->leftJoinCacheActors($qb, 'attributed_to');
$this->leftJoinStreamAction($qb);
$notes = [];
$cursor = $qb->execute();
@ -419,6 +424,7 @@ class NotesRequest extends NotesRequestBuilder {
public function getNotesSince(int $since): array {
$qb = $this->getNotesSelectSql();
$this->limitToSince($qb, $since, 'published_time');
$this->leftJoinStreamAction($qb);
$notes = [];
$cursor = $qb->execute();