diff --git a/include/photos.php b/include/photos.php index 15d2139c9..a1957ea1b 100644 --- a/include/photos.php +++ b/include/photos.php @@ -10,6 +10,7 @@ use Code\Lib\Activity; use Code\Access\AccessControl; use Code\Access\PermissionLimits; use Code\Lib\Channel; +use Code\Lib\PConfig; use Code\Lib\Time; use Code\Web\HTTPHeaders; use Code\Daemon\Run; @@ -438,10 +439,11 @@ function photo_upload($channel, $observer, $args) $object['to'] = Activity::map_acl(array_merge($ac, ['item_private' => 1])); } + $isNomadic = PConfig::Get($channel['channel_id'], 'system', 'nomadicAP'); $target = [ 'type' => 'Collection', 'name' => ((strlen($album)) ? $album : '/'), - 'id' => Channel::getDidResolver($channel) . '/album/' . ((isset($args['folder'])) ? '/' . $args['folder'] : EMPTY_STR), + 'id' => (($isNomadic) ? Channel::getDidResolver($channel) : z_root()) . '/album/' . ((isset($args['folder'])) ? '/' . $args['folder'] : EMPTY_STR), 'attributedTo' => Channel::getDidResolver($channel, true), ]; @@ -515,7 +517,7 @@ function photo_upload($channel, $observer, $args) } } else { $uuid = new_uuid(); - $mid = Channel::getDidResolver($channel) . '/item/' . $uuid; + $mid = (($isNomadic) ? Channel::getDidResolver($channel) : z_root()) . '/item/' . $uuid; $object['id'] = $mid;