summaryrefslogtreecommitdiffstats
path: root/lib/Service/CurlService.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Service/CurlService.php')
-rw-r--r--lib/Service/CurlService.php10
1 files changed, 8 insertions, 2 deletions
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 {