update account on retreive

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/578/head
Maxence Lange 2019-06-12 13:10:21 -01:00
rodzic ede7d0d732
commit 35389b47af
3 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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 {

Wyświetl plik

@ -90,7 +90,7 @@ if (substr($href, -1) === '/') {
}
$finger = [
'subject' => $username . '@' . $instance,
'subject' => 'acct:' . $username . '@' . $instance,
'links' => [
[
'rel' => 'self',