diff options
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/CacheActorService.php | 4 | ||||
-rw-r--r-- | lib/Service/CurlService.php | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/Service/CacheActorService.php b/lib/Service/CacheActorService.php index e0c989d8..41ec3954 100644 --- a/lib/Service/CacheActorService.php +++ b/lib/Service/CacheActorService.php @@ -185,13 +185,15 @@ class CacheActorService { * @throws CacheActorDoesNotExistException * @throws InvalidOriginException * @throws InvalidResourceException + * @throws ItemUnknownException * @throws MalformedArrayException * @throws RedundancyLimitException * @throws RequestContentException - * @throws RetrieveAccountFormatException * @throws RequestNetworkException + * @throws RequestResultNotJsonException * @throws RequestResultSizeException * @throws RequestServerException + * @throws RetrieveAccountFormatException * @throws SocialAppConfigException * @throws ItemUnknownException * @throws RequestResultNotJsonException diff --git a/lib/Service/CurlService.php b/lib/Service/CurlService.php index ccf315cd..7775baff 100644 --- a/lib/Service/CurlService.php +++ b/lib/Service/CurlService.php @@ -109,7 +109,7 @@ class CurlService { * @throws SocialAppConfigException * @throws UnauthorizedFediverseException */ - public function webfingerAccount(string $account): array { + public function webfingerAccount(string &$account): array { $account = $this->withoutBeginAt($account); // we consider an account is like an email @@ -141,6 +141,12 @@ class CurlService { } else throw $e; } + $subject = $this->get('subject', $result, ''); + list($type, $temp) = explode(':', $subject, 2); + if ($type === 'acct') { + $account = $temp; + } + return $result; } @@ -189,7 +195,7 @@ class CurlService { * @throws RequestResultNotJsonException * @throws UnauthorizedFediverseException */ - public function retrieveAccount(string $account): Person { + public function retrieveAccount(string &$account): Person { $result = $this->webfingerAccount($account); try { |