kopia lustrzana https://github.com/nextcloud/social
commit
89a6c5cdd4
|
@ -140,7 +140,14 @@ class Timeline extends ExtendedBase {
|
|||
if ($input->getOption('local')) {
|
||||
$options->setLocal(true);
|
||||
}
|
||||
$options->setProbe($input->getArgument('timeline'));
|
||||
|
||||
$timeline = $input->getArgument('timeline');
|
||||
if (str_starts_with($timeline, '#')) {
|
||||
$options->setProbe(ProbeOptions::HASHTAG)
|
||||
->setArgument(substr($timeline, 1));
|
||||
} else {
|
||||
$options->setProbe($timeline);
|
||||
}
|
||||
|
||||
if ($input->getOption('account') !== '') {
|
||||
$local = $this->cacheActorService->getFromLocalAccount($input->getOption('account'));
|
||||
|
|
|
@ -395,7 +395,7 @@ class StreamRequest extends StreamRequestBuilder {
|
|||
$result = $this->getTimelineFavourites($options);
|
||||
break;
|
||||
case ProbeOptions::HASHTAG:
|
||||
$result = $this->getTimelineHashtag($options, $options->getArgument());
|
||||
$result = $this->getTimelineHashtag($options);
|
||||
break;
|
||||
case ProbeOptions::NOTIFICATIONS:
|
||||
$options->setFormat(ACore::FORMAT_NOTIFICATION);
|
||||
|
@ -528,10 +528,20 @@ class StreamRequest extends StreamRequestBuilder {
|
|||
*
|
||||
* @return Stream[]
|
||||
*/
|
||||
private function getTimelineHashtag(ProbeOptions $options, string $hashtag): array {
|
||||
private function getTimelineHashtag(ProbeOptions $options): array {
|
||||
$qb = $this->getStreamSelectSql($options->getFormat());
|
||||
$qb->limitToType(Note::TYPE);
|
||||
$qb->paginate($options);
|
||||
|
||||
return [];
|
||||
$expr = $qb->expr();
|
||||
$qb->linkToCacheActors('ca', 's.attributed_to_prim');
|
||||
$qb->linkToStreamTags('st', 's.id_prim');
|
||||
$qb->andWhere($qb->exprLimitToDBField('hashtag', $options->getArgument(), true, false, 'st'));
|
||||
|
||||
$qb->limitToViewer('sd', 'f', true);
|
||||
$qb->andWhere($expr->eq('s.attributed_to_prim', 'ca.id_prim'));
|
||||
|
||||
$qb->leftJoinStreamAction('sa');
|
||||
|
||||
return $this->getStreamsFromRequest($qb);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue