sforkowany z mirror/social
cleaning
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>feature/noid/sql-rewrite-0929^2
rodzic
dd1613463b
commit
dd57e9adec
|
@ -158,45 +158,6 @@ class StreamRequestBuilder extends CoreRequestBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param IQueryBuilder $qb
|
|
||||||
*/
|
|
||||||
protected function filterHiddenOnTimeline(IQueryBuilder $qb) {
|
|
||||||
$actor = $this->viewer;
|
|
||||||
|
|
||||||
if ($actor === null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$func = $qb->func();
|
|
||||||
$expr = $qb->expr();
|
|
||||||
|
|
||||||
$filter = $expr->orX();
|
|
||||||
$filter->add($this->exprLimitToDBFieldInt($qb, 'hidden_on_timeline', 0));
|
|
||||||
|
|
||||||
$filter->add(
|
|
||||||
$expr->neq(
|
|
||||||
$func->lower('attributed_to'),
|
|
||||||
$func->lower($qb->createNamedParameter($actor->getId()))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$follower = $expr->andX();
|
|
||||||
$follower->add(
|
|
||||||
$expr->eq(
|
|
||||||
$func->lower('f.object_id'),
|
|
||||||
$func->lower('attributed_to')
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$follower->add(
|
|
||||||
$this->exprLimitToDBField($qb, 'actor_id', $actor->getId(), true, false, 'f')
|
|
||||||
);
|
|
||||||
$filter->add($follower);
|
|
||||||
|
|
||||||
$qb->andwhere($filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param IQueryBuilder $qb
|
* @param IQueryBuilder $qb
|
||||||
* @param Person $actor
|
* @param Person $actor
|
||||||
|
@ -317,6 +278,7 @@ class StreamRequestBuilder extends CoreRequestBuilder {
|
||||||
* @param string $recipient
|
* @param string $recipient
|
||||||
* @param bool $asAuthor
|
* @param bool $asAuthor
|
||||||
* @param array $type
|
* @param array $type
|
||||||
|
*
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
protected function limitToRecipient(
|
protected function limitToRecipient(
|
||||||
|
@ -331,8 +293,9 @@ class StreamRequestBuilder extends CoreRequestBuilder {
|
||||||
* @param string $recipient
|
* @param string $recipient
|
||||||
* @param bool $asAuthor
|
* @param bool $asAuthor
|
||||||
* @param array $type
|
* @param array $type
|
||||||
* @deprecated
|
*
|
||||||
* @return ICompositeExpression
|
* @return ICompositeExpression
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
protected function exprLimitToRecipient(
|
protected function exprLimitToRecipient(
|
||||||
IQueryBuilder &$qb, string $recipient, bool $asAuthor = false, array $type = []
|
IQueryBuilder &$qb, string $recipient, bool $asAuthor = false, array $type = []
|
||||||
|
|
Ładowanie…
Reference in New Issue