From b96874d6a3ac3e7150ae3d0b50ad30f0173727e2 Mon Sep 17 00:00:00 2001 From: Emerson Kfuri Date: Wed, 16 Jan 2019 17:41:17 -0200 Subject: Update CacheActorsRequest.php Signed-off-by: Emerson Kfuri --- lib/Db/CacheActorsRequest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Db/CacheActorsRequest.php b/lib/Db/CacheActorsRequest.php index 82a2f5de..7051dfb3 100644 --- a/lib/Db/CacheActorsRequest.php +++ b/lib/Db/CacheActorsRequest.php @@ -220,6 +220,9 @@ class CacheActorsRequest extends CacheActorsRequestBuilder { */ public function getFromLocalAccount(string $account): Person { $qb = $this->getCacheActorsSelectSql(); + if (strrpos($account, '@')) { + $account = substr($account, 0, strrpos($account, '@')); + } $this->limitToPreferredUsername($qb, $account); $this->limitToLocal($qb, true); $this->leftJoinCacheDocuments($qb, 'icon_id'); -- cgit v1.2.3 From 3356464707b017a7351f1592bdcc8497687eaf58 Mon Sep 17 00:00:00 2001 From: emersonkfuri Date: Thu, 17 Jan 2019 15:35:04 -0200 Subject: Always use $account as local account (suppress @instance) Signed-off-by: emersonkfuri --- lib/Service/CacheActorService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Service/CacheActorService.php b/lib/Service/CacheActorService.php index d4e4473f..1030f699 100644 --- a/lib/Service/CacheActorService.php +++ b/lib/Service/CacheActorService.php @@ -166,6 +166,9 @@ class CacheActorService { * @throws CacheActorDoesNotExistException */ public function getFromLocalAccount(string $account): Person { + if (strrpos($account, '@')) { + $account = substr($account, 0, strrpos($account, '@')); + } return $this->cacheActorsRequest->getFromLocalAccount($account); } -- cgit v1.2.3 From 73119cde8c15843c26265844b8fbd9cf460a17e8 Mon Sep 17 00:00:00 2001 From: Emerson Kfuri Date: Thu, 17 Jan 2019 15:48:01 -0200 Subject: Update CacheActorsRequest.php Signed-off-by: emersonkfuri --- lib/Db/CacheActorsRequest.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/Db/CacheActorsRequest.php b/lib/Db/CacheActorsRequest.php index 7051dfb3..82a2f5de 100644 --- a/lib/Db/CacheActorsRequest.php +++ b/lib/Db/CacheActorsRequest.php @@ -220,9 +220,6 @@ class CacheActorsRequest extends CacheActorsRequestBuilder { */ public function getFromLocalAccount(string $account): Person { $qb = $this->getCacheActorsSelectSql(); - if (strrpos($account, '@')) { - $account = substr($account, 0, strrpos($account, '@')); - } $this->limitToPreferredUsername($qb, $account); $this->limitToLocal($qb, true); $this->leftJoinCacheDocuments($qb, 'icon_id'); -- cgit v1.2.3