From 78b6a807cb7e634c7b99d7a40c0e17c1c0a57562 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Tue, 30 Apr 2024 08:24:34 +1000 Subject: [PATCH] update to latest fep-ef61 'gateway' changes --- src/ActivityStreams/Actor.php | 12 ++++++------ src/Lib/Activity.php | 15 ++++++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/ActivityStreams/Actor.php b/src/ActivityStreams/Actor.php index a7d358532..d8909be1f 100644 --- a/src/ActivityStreams/Actor.php +++ b/src/ActivityStreams/Actor.php @@ -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; } diff --git a/src/Lib/Activity.php b/src/Lib/Activity.php index 966112f81..ad65e4dd4 100644 --- a/src/Lib/Activity.php +++ b/src/Lib/Activity.php @@ -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) ]];