kopia lustrzana https://github.com/nextcloud/social
update account on retreive
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>pull/578/head
rodzic
ede7d0d732
commit
35389b47af
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -90,7 +90,7 @@ if (substr($href, -1) === '/') {
|
|||
}
|
||||
|
||||
$finger = [
|
||||
'subject' => $username . '@' . $instance,
|
||||
'subject' => 'acct:' . $username . '@' . $instance,
|
||||
'links' => [
|
||||
[
|
||||
'rel' => 'self',
|
||||
|
|
Ładowanie…
Reference in New Issue