clarifications to container doc

This commit is contained in:
Mike Macgirvin 2024-04-02 07:29:38 +11:00
parent 88d7b0d2a5
commit 10f1f1a60f
2 changed files with 5 additions and 5 deletions

View file

@ -21,11 +21,12 @@ In the conversational model, the same basic steps occur, but respects the rights
A constrained conversation is implemented as a Collection. [FEP-400e](https://codeberg.org/fediverse/fep/src/branch/main/fep/400e/fep-400e.md) provides a model for working with collections. In that proposal, ActivityPub objects which are created as part of a collection are indicated by a `target` "stub" property containing
- type -- ( `Collection` or `OrderedCollection` )
- type -- ( `Collection` or `OrderedCollection` of activities)
- id -- a URL where this collection can be found
- attributedTo -- the `id` of the collection owner
In a constrained conversation, conforming implementations will implement FEP-400e with some very minor additions:
- The collection contains complete activities, not simple objects.
- In a constrained conversation, the target->id and the context are identical. This provides easy identification.
- In a constrained conversation, replies SHOULD only be addressed to the target->attributedTo actor.
- When receiving a correctly signed `Add` activity, checking that the id of the target is a collection owned by `actor` is slightly different from FEP-400e. This can be accomplished by fetching the Collection object and validating the attributedTo field.

View file

@ -4989,7 +4989,6 @@ class Activity
public static function addToCollection($channel, $object, $target, $sourceItem = null, $deliver = true)
{
btlogger('addtocollection');
if (!isset($channel['xchan_hash'])) {
$channel = Channel::from_hash($channel['channel_hash']);
}
@ -5006,7 +5005,7 @@ class Activity
->setReplyto(z_root() . '/channel/' . $channel['channel_address'])
->setTgtType('Collection')
->setTarget([
'id' => $target,
'id' => str_replace('/item/','/conversation/', $target),
'type' => 'Collection',
'attributedTo' => z_root() . '/channel/' . $channel['channel_address']
]
@ -5043,7 +5042,7 @@ class Activity
->setReplyto(z_root() . '/channel/' . $channel['channel_address'])
->setTgtType('Collection')
->setTarget([
'id' => $target,
'id' => str_replace('/item/','/conversation/', $target),
'type' => 'Collection',
'attributedTo' => z_root() . '/channel/' . $channel['channel_address']
]