[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

@@ -98,6 +98,14 @@ abstract class Common
}
}
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']);
}
public static function ensureLoggedIn(): LocalUser
{
if (($user = self::user()) == null) {