store did records as network type 'apnomadic'

This commit is contained in:
Mike Macgirvin 2024-03-21 21:04:17 +11:00
parent e6b1ce2a42
commit 86867970d7

View file

@ -2316,6 +2316,13 @@ class Activity
return; return;
} }
$actorId = new ActorId($url);
$url = $actorId->getId();
$isDid = $actorId->getType() === ActorId::ACTORID_TYPE_DID;
if ($isDid) {
$aliases = $person_obj['aliases'];
}
// store the actor record in XConfig // store the actor record in XConfig
XConfig::Set($url, 'system', 'actor_record', $person_obj); XConfig::Set($url, 'system', 'actor_record', $person_obj);
@ -2499,7 +2506,7 @@ class Activity
'xchan_hidden' => intval($hidden), 'xchan_hidden' => intval($hidden),
'xchan_updated' => Time::convert(), 'xchan_updated' => Time::convert(),
'xchan_name_date' => Time::convert(), 'xchan_name_date' => Time::convert(),
'xchan_network' => 'activitypub', 'xchan_network' => $isDid ? 'apnomadic' : 'activitypub',
'xchan_type' => $xchan_type, 'xchan_type' => $xchan_type,
'xchan_photo_date' => Time::convert('UTC', 'UTC', '1968-01-01'), 'xchan_photo_date' => Time::convert('UTC', 'UTC', '1968-01-01'),
'xchan_photo_l' => z_root() . '/' . Channel::get_default_profile_photo(), 'xchan_photo_l' => z_root() . '/' . Channel::get_default_profile_photo(),
@ -2525,7 +2532,7 @@ class Activity
dbesc($name), dbesc($name),
dbesc($pubkey), dbesc($pubkey),
dbesc($epubkey), dbesc($epubkey),
dbesc('activitypub'), dbesc($isDid ? 'apnomadic' : 'activitypub'),
dbesc(Time::convert()), dbesc(Time::convert()),
intval($hidden), intval($hidden),
intval($xchan_type), intval($xchan_type),
@ -2635,7 +2642,7 @@ class Activity
'hubloc_hash' => $url, 'hubloc_hash' => $url,
'hubloc_id_url' => $profile, 'hubloc_id_url' => $profile,
'hubloc_addr' => $webfingerAddress, 'hubloc_addr' => $webfingerAddress,
'hubloc_network' => 'activitypub', 'hubloc_network' => $isDid ? 'apnomadic' : 'activitypub',
'hubloc_url' => $baseurl, 'hubloc_url' => $baseurl,
'hubloc_host' => $hostname, 'hubloc_host' => $hostname,
'hubloc_callback' => $inbox, 'hubloc_callback' => $inbox,