Merge branch 'nomadic' of codeberg.org:streams/streams into nomadic

This commit is contained in:
Mike Macgirvin 2024-04-30 17:25:54 +10:00
commit 2db88e458f
2 changed files with 14 additions and 13 deletions

View file

@ -23,7 +23,7 @@ class Actor extends ASObject
public $canSearch;
public $indexable;
public $assertionMethod;
public $aliases;
public $gateway;
public $permissions;
public $openwebauth;
public $authredirect;
@ -356,18 +356,18 @@ class Actor extends ASObject
/**
* @return mixed
*/
public function getAliases()
public function getGateway()
{
return $this->aliases;
return $this->gateway;
}
/**
* @param mixed $aliases
* @param mixed $gateway
* @return Actor
*/
public function setAliases($aliases)
public function setGateway($gateway)
{
$this->aliases = $aliases;
$this->gateway = $gateway;
return $this;
}

View file

@ -1622,7 +1622,7 @@ class Activity
$actor = new Actor();
$currhub = false;
$aliases =[];
$gateways =[];
$nomadic = false;
$channel = ((array_key_exists('channel_id', $p)) ? $p : Channel::from_hash($p['xchan_hash']));
@ -1673,9 +1673,9 @@ class Activity
$locations = self::nomadic_locations(['author_xchan' => $channel['channel_hash']]);
if ($locations) {
foreach ($locations as $location) {
$aliases[] = $location['hubloc_id_url'];
$gateways[] = $location['hubloc_url'];
}
$actor->setAliases($aliases);
$actor->setGateway($gateways);
}
$actor->setId($nomadic ? Channel::getDidResolver($channel) : Channel::url($channel));
} else {
@ -2357,7 +2357,7 @@ class Activity
$url = $actorId->getId();
$isDid = $actorId->getType() === ActorId::ACTORID_TYPE_DID;
if ($isDid) {
$aliases = $person_obj['aliases'];
$gateways = $person_obj['gateway'];
}
// store the actor record in XConfig
@ -5101,9 +5101,10 @@ class Activity
'https://w3id.org/security/multikey/v1',
'https://w3id.org/security/data-integrity/v1',
'https://purl.archive.org/socialweb/webfinger',
[
'fep' => 'https://w3id.org/fep/ef61#',
'aliases' => 'fep:aliases'
'gateway' => [
'@id' => 'https://w3id.org/fep/ef61/gateway',
'@type' => '@id',
'@container' => '@list'
],
self::ap_schema($contextType)
]];