From 9edfc83a8f4fdd2a4e338177a1a0d9d81e276ac9 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 10 Oct 2019 16:00:27 -0100 Subject: [PATCH] cleaning Signed-off-by: Maxence Lange --- appinfo/routes.php | 2 +- lib/Db/SocialLimitsQueryBuilder.php | 9 ++++++++- lib/Db/StreamRequest.php | 4 ---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index f88528b8..077c37ee 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -50,7 +50,7 @@ return [ ['name' => 'Navigation#resizedGetPublic', 'url' => '/document/public/resized', 'verb' => 'GET'], ['name' => 'ActivityPub#actor', 'url' => '/users/{username}', 'verb' => 'GET'], - ['name' => 'ActivityPub#actorAlias', 'url' => '/@{username}/', 'verb' => 'GET'], + ['name' => 'ActivityPub#actorAlias', 'url' => '/@{username}', 'verb' => 'GET'], ['name' => 'ActivityPub#inbox', 'url' => '/@{username}/inbox', 'verb' => 'POST'], ['name' => 'ActivityPub#getInbox', 'url' => '/@{username}/inbox', 'verb' => 'GET'], ['name' => 'ActivityPub#sharedInbox', 'url' => '/inbox', 'verb' => 'POST'], diff --git a/lib/Db/SocialLimitsQueryBuilder.php b/lib/Db/SocialLimitsQueryBuilder.php index d3a4ff47..50877b8b 100644 --- a/lib/Db/SocialLimitsQueryBuilder.php +++ b/lib/Db/SocialLimitsQueryBuilder.php @@ -76,8 +76,15 @@ class SocialLimitsQueryBuilder extends SocialCrossQueryBuilder { * Limit the request to the Id (string) * * @param string $id + * @param bool $prim */ - public function limitToInReplyTo(string $id) { + public function limitToInReplyTo(string $id, bool $prim = false) { + if ($prim) { + $this->limitToDBField('in_reply_to_prim', $this->prim($id), false); + + return; + } + $this->limitToDBField('in_reply_to', $id, false); } diff --git a/lib/Db/StreamRequest.php b/lib/Db/StreamRequest.php index f9d86249..7e5ec825 100644 --- a/lib/Db/StreamRequest.php +++ b/lib/Db/StreamRequest.php @@ -274,11 +274,7 @@ class StreamRequest extends StreamRequestBuilder { $qb->limitToInReplyTo($id); $qb->limitPaginate($since, $limit); - $expr = $qb->expr(); $qb->linkToCacheActors('ca', 's.attributed_to_prim'); - - $qb->andWhere($expr->eq('s.attributed_to', 'ca.id_prim')); - if ($asViewer) { $qb->limitToViewer('sd', 'f', true); $qb->leftJoinStreamAction();