minor refactor

This commit is contained in:
Mike Macgirvin 2024-07-07 09:16:11 +10:00
parent dded3cdbb2
commit 1862ab9516

View file

@ -1713,9 +1713,13 @@ class Activity
if ($channel) {
$locations = self::nomadic_locations(['author_xchan' => $channel['channel_hash']]);
$aplocations = self::nomadic_locations(['author_xchan' => Channel::getDid($channel)]);
$legacyLocation = z_root() . '/channel/' . $channel['channel_address'];
$aka[] = Channel::getDidResolver($channel, true);
$aka[] = z_root() . '/.well-known/nomad-gateway/' . $channel['xchan_hash'] . '/actor';
$aka[] = z_root() . '/channel/' . $channel['channel_address'];
if (! in_array($legacyLocation, $aka)) {
$aka[] = $legacyLocation;
}
$gateways[] = z_root();
if ($locations) {
foreach ($locations as $location) {
@ -1725,7 +1729,7 @@ class Activity
if (! in_array($location['hubloc_url'], $gateways)) {
$gateways[] = $location['hubloc_url'];
}
if (! in_array($location['hubloc_url'] . '/.well-known/nomad-gateway/' . $location['hubloc_hash'] . '/actor', $aka)) {
if (!in_array($location['hubloc_url'] . '/.well-known/nomad-gateway/' . $location['hubloc_hash'] . '/actor', $aka)) {
$aka[] = $location['hubloc_url'] . '/.well-known/nomad-gateway/' . $location['hubloc_hash'] . '/actor';
}
if (! in_array($location['hubloc_id_url'], $aka)) {