forked from GNUsocial/gnu-social
[COMPONENT][Tag] Update tag stream to use new pagedStream format
This commit is contained in:
parent
69e7dc44bd
commit
c6082bab10
@ -4,18 +4,21 @@ namespace Component\Tag\Controller;
|
|||||||
|
|
||||||
use App\Core\Cache;
|
use App\Core\Cache;
|
||||||
use App\Core\Controller;
|
use App\Core\Controller;
|
||||||
|
use App\Util\Common;
|
||||||
use Component\Tag\Tag as CompTag;
|
use Component\Tag\Tag as CompTag;
|
||||||
|
|
||||||
class Tag extends Controller
|
class Tag extends Controller
|
||||||
{
|
{
|
||||||
public function tag(string $tag)
|
public function tag(string $tag)
|
||||||
{
|
{
|
||||||
$page = $this->int('page') ?: 1;
|
$user = Common::user();
|
||||||
$tag = CompTag::canonicalTag($tag);
|
$page = $this->int('page') ?: 1;
|
||||||
$notes = Cache::pagedStream(
|
$canonical = CompTag::canonicalTag($tag);
|
||||||
key: "tag-{$tag}",
|
$notes = Cache::pagedStream(
|
||||||
query: 'select n from note n join note_tag nt with nt.note_id = n.id where nt.canonical = :tag order by nt.created DESC, n.id DESC',
|
key: "tag-{$canonical}",
|
||||||
query_args: ['tag' => $tag],
|
query: 'select n from note n join note_tag nt with n.id = nt.note_id where nt.canonical = :canon order by nt.created DESC, nt.note_id DESC',
|
||||||
|
query_args: ['canon' => $canonical],
|
||||||
|
actor: $user,
|
||||||
page: $page
|
page: $page
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user