[UI][TIMELINES] Refactored query for public stream

This commit is contained in:
João Brandão
2020-12-02 22:57:32 +00:00
committed by Hugo Sales
parent c36436c1a1
commit 5516a77b33
4 changed files with 22 additions and 2 deletions

View File

@@ -199,6 +199,15 @@ class Note extends Entity
Event::handle('GetAvatarUrl', [$this->getActorNickname(), &$url]);
return $url;
}
public function getAllNotes(int $noteScope): array
{
return DB::sql('select * from note n ' .
'where n.reply_to is null and (n.scope & :notescope) <> 0 ' .
'order by n.created DESC',
['n' => 'App\Entity\Note'],
['notescope' => $noteScope]
);
}
public function getAttachments(): array
{