cleanup and fixes

This commit is contained in:
Mike Macgirvin 2024-07-06 06:16:49 +10:00
parent a52fcc2de7
commit a25f4e5f7b
3 changed files with 12 additions and 5 deletions

View file

@ -1101,9 +1101,9 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null)
}
if ($notify) {
$cloudPath = Channel::getDidResolver($channel) . '/cloud/' . $channel['channel_address'] . '/' . $r['0']['display_path'];
$object = get_file_activity_object($channel['channel_id'], $r['0']['hash'], $cloudPath);
file_activity($channel['channel_id'], $object, $r['0']['allow_cid'], $r['0']['allow_gid'], $r['0']['deny_cid'], $r['0']['deny_gid'], 'post', $notify);
$cloudPath = Channel::getDidResolver($channel) . '/cloud/' . $channel['channel_address'] . '/' . $r[0]['display_path'];
$object = get_file_activity_object($channel['channel_id'], $r[0]['hash'], $cloudPath);
file_activity($channel['channel_id'], $object, $r[0]['allow_cid'], $r[0]['allow_gid'], $r[0]['deny_cid'], $r[0]['deny_gid'], 'post', $notify);
}
return $ret;

View file

@ -2089,7 +2089,14 @@ class Channel
public static function getDidResolver($channel, $isActor = false)
{
return z_root() . '/.well-known/apgateway/' . self::getDid($channel) . (($isActor) ? '/actor' : '');
$isNomadic = PConfig::Get($channel['channel_id'], 'system', 'nomadicAP');
if ($isActor) {
return (($isNomadic)
? z_root() . '/.well-known/apgateway/' . self::getDid($channel) . '/actor'
: z_root() . '/channel/' . $channel['channel_address']
);
}
return z_root() . '/.well-known/apgateway/' . self::getDid($channel);
}
public static function getNomadResolver($channel, $isActor = false)

View file

@ -271,7 +271,7 @@ class Outbox extends Controller
}
if (App::$pager['unset'] && $total > 100) {
$ret = Activity::paged_collection_init($total, App::$query_string, attributedTo: z_root() . '/channel/' . $channel['channel_address']);
$ret = Activity::paged_collection_init($total, App::$query_string, attributedTo: Channel::getDidResolver($channel, true));
} else {
$items = items_fetch(
[