make inbox multi-protocol (activitypub and apnomadic)

This commit is contained in:
Mike Macgirvin 2024-05-17 20:36:12 +10:00
parent 0921618035
commit a3c7362e6f
2 changed files with 8 additions and 3 deletions

View file

@ -3355,6 +3355,11 @@ class Libzot
return $v;
}
}
foreach ($arr as $v) {
if ($v[$check] === 'apnomadic') {
return $v;
}
}
return $arr[0];
}

View file

@ -200,7 +200,7 @@ class Inbox extends Controller
// update the hubloc_connected timestamp, ignore failures
q("update hubloc set hubloc_connected = '%s' where hubloc_hash = '%s' and hubloc_network = 'activitypub'",
q("update hubloc set hubloc_connected = '%s' where hubloc_hash = '%s' and hubloc_network in ('activitypub', 'apnomadic')",
dbesc(Time::convert()),
dbesc($observer_hash)
);
@ -241,7 +241,7 @@ class Inbox extends Controller
if (!empty($actor['id'])) {
$tmp = q("SELECT * from channel where channel_id in
( SELECT abook_channel from abook left join xchan on abook_xchan = xchan_hash
WHERE xchan_network = 'activitypub' and xchan_hash = '%s'
WHERE xchan_network in ('activitypub', 'apnomadic') and xchan_hash = '%s'
) and channel_removed = 0 ",
dbesc($actor['id'])
);
@ -271,7 +271,7 @@ class Inbox extends Controller
$channels = q(
"SELECT * from channel where channel_id in
( SELECT abook_channel from abook left join xchan on abook_xchan = xchan_hash
WHERE xchan_network = 'activitypub' and xchan_hash = '%s'
WHERE xchan_network in ('activitypub', 'apnomadic') and xchan_hash = '%s'
) and channel_removed = 0 ",
dbesc($observer_hash)
);