diff --git a/src/Lib/Activity.php b/src/Lib/Activity.php index 71da9181b..0b058b909 100644 --- a/src/Lib/Activity.php +++ b/src/Lib/Activity.php @@ -1214,7 +1214,8 @@ class Activity } } - $activity['attributedTo'] = Channel::getDidResolver($item['author'], true); + + $activity['attributedTo'] = self::actorEncode($item['author'],false); if ($item['mid'] === $item['parent_mid']) { if (in_array($item['comment_policy'], ['self', 'none']) || $item['item_nocomment'] || ($item['comments_closed'] > NULL_DATE && Time::convert('UTC', 'UTC', $item['comments_closed']) <= Time::convert())) { @@ -5183,6 +5184,7 @@ class Activity if (!isset($channel['xchan_hash'])) { $channel = Channel::from_hash($channel['channel_hash']); } + $isNomadic = PConfig::Get($channel['channel_id'], 'system', 'nomadicAP'); $item = ((new Item()) ->setUid($channel['channel_id']) ->setVerb('Add') @@ -5198,7 +5200,7 @@ class Activity ->setTarget([ 'id' => str_replace('/item/','/conversation/', $target), 'type' => 'Collection', - 'attributedTo' => Channel::getDidResolver($channel, true) + 'attributedTo' => (($isNomadic) ? Channel::getDidResolver($channel, true) : z_root() . '/channel/' . $channel['channel_address']), ] ) ); @@ -5221,6 +5223,7 @@ class Activity if (!isset($channel['xchan_hash'])) { $channel = Channel::from_hash($channel['channel_hash']); } + $isNomadic = PConfig::Get($channel['channel_id'], 'system', 'nomadicAP'); $item = ((new Item()) ->setUid($channel['channel_id']) ->setVerb('Remove') @@ -5235,7 +5238,7 @@ class Activity ->setTarget([ 'id' => str_replace('/item/','/conversation/', $target), 'type' => 'Collection', - 'attributedTo' => Channel::getDidResolver($channel, true) + 'attributedTo' => (($isNomadic) ? Channel::getDidResolver($channel, true) : z_root() . '/channel/' . $channel['channel_address']), ] ) );