# Where and how to send join activity?

**URL:** <https://socialhub.activitypub.rocks/t/where-and-how-to-send-join-activity/4263>\
**Category:** ActivityPub\
**Created:** [May 22, 2024, 6:48pm UTC](https://socialhub.activitypub.rocks/t/where-and-how-to-send-join-activity/4263 "2024-05-22T18:48:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wobber](https://socialhub.activitypub.rocks/letter_avatar_proxy/v4/letter/w/a3d4f5/32.png) [@wobber](https://socialhub.activitypub.rocks/u/wobber)\
**Post date:** [May 22, 2024, 6:48pm UTC](https://socialhub.activitypub.rocks/t/where-and-how-to-send-join-activity/4263/1 "2024-05-22T18:48:58Z")

</div>

Hi,

I just want to make sure I have understood everything correctly. If not, please correct me.

When a user wants to join a group, the client publishes a join activity to the user’s outbox, with the user as the actor, the group as the object, and the group as the recipient (to)?

```auto
{
 "@context": ["https://www.w3.org/ns/activitystreams",
              {"@language": "en"}],
 "type": "Join",
 "actor": "https://some-social-network.org/alice",
 "name": "Alice joins 'Example Group'",
 "object": "https://other-network.co.uk/groups/example-group",
 "to": ["https://other-network.co.uk/groups/example-group"],
}

```

The server then looks up the group’s actor object to get its inbox and sends the activity to it. The group’s server must now add the user to a collection (is there a collection like members, or should I use followers here?) and post an accept activity to the server’s outbox (or, if the user is not added to a collection, post a reject activity).

```auto
{
  "@context": ["https://www.w3.org/ns/activitystreams",
               {"@language": "en"}],
  "type": "Accept",
  "actor": "https://other-network.co.uk/groups/example-group",
  "name": "Alice joined 'Example Group'",
  "object": {
    "type": "Join",
    "actor": "https://some-social-network.org/alice",
    "object": "https://other-network.co.uk/groups/example-group",
  },
  "to": ["https://some-social-network.org/alice",
         "https://other-network.co.uk/groups/example-group/followers/"]
}

```

I am also wondering: Should the user’s server match the accept/reject activity with the previous join activity? And should I use IDs here for faster lookup?  
I am also considering edge cases where accepting/rejecting is a manual process and a user might revoke their join activity before a response is received.

---

<div class="post-metadata">

**Author:** ![trwnh](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/trwnh/32/262_2.png) [@trwnh](https://socialhub.activitypub.rocks/u/trwnh)\
**Post date:** [May 23, 2024, 1:38am UTC](https://socialhub.activitypub.rocks/t/where-and-how-to-send-join-activity/4263/2 "2024-05-23T01:38:42Z")

</div>

The `Join` activity is not part of ActivityPub. Only `Follow` is.

> [@wobber](#):
>
> The group’s server must now add the user to a collection (is there a collection like members, or should I use followers here?)

This is extension territory. There is no specified way within Activity Streams 2.0 or special collection within ActivityPub to signal members of a group. You should not use `followers` unless you are dealing with `Follow` activities.

(The following is theoretical conjecture:)

If you wanted to pursue this further, the “weakest” way of signaling group members is to use `vcard:hasMember` from the VCard Ontology that is recommended by AS2 (and its prefix is part of the AS2 context document). I say “weakest” because this is literally just a JSON array and comes with none of the advantages of a collection:

```json
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Group",
  "vcard:hasMember": [
    {"id": "https://social.example/users/1"},
    {"id": "https://social.example/users/2"},
    // ...
    {"id": "https://social.example/users/100"},
  ]
}

```

Probably the “better” way is to write a FEP for a `members` collection and how it would work. This is pretty open-ended for now, so you would need to pretty concisely bound behavior in such a way as to be useful. For example, by defining the following provisions:

- The `members` collection indicates that the actor accepts `Join`/`Leave` activities?
- Some property like `manuallyAcceptsJoins` to indicate that the `Accept Join` will not be automatically received ~immediately? This mirrors the `manuallyApprovesFollowers` extension property in popular usage with current implementations in the fediverse.
- Heavy consideration needs to be given to the privileges granted by being a member vs being a follower, or being both! Or being followed by the group, etc etc.
- More consideration needs to be given ahead-of-time to how to remove a member from a group, and who can do so. Something like deciding “the `attributedTo` actor (or some other further extension `moderator`?) can issue a `Remove` activity targeting the group’s `members` collection, or otherwise send a `Reject Join` at any future point, or [other potential scenarios]”.

> [@wobber](#):
>
> I am also wondering: Should the user’s server match the accept/reject activity with the previous join activity? And should I use IDs here for faster lookup?

This is an open issue for Follow activities too, and the guidance is basically like so:

- The sender of the Follow activity SHOULD include an id, just like any other non-transient activity.
- The receiver of a Follow activity SHOULD include the id received, either directly, or by embedding a (possibly partial) representation of the Follow activity they just received (within `object`).
- The receiver of an `Accept Follow` or `Reject Follow` may not receive an inner id on their Follow object from certain implementations, so they will have to keep track of an internal follow-request state machine and match against pending follow requests.

---

<div class="post-metadata">

**Author:** ![wobber](https://socialhub.activitypub.rocks/letter_avatar_proxy/v4/letter/w/a3d4f5/32.png) [@wobber](https://socialhub.activitypub.rocks/u/wobber)\
**Post date:** [May 27, 2024, 10:11am UTC](https://socialhub.activitypub.rocks/t/where-and-how-to-send-join-activity/4263/3 "2024-05-27T10:11:43Z")

</div>

Thanks for your response.

> [@trwnh](#):
>
> The `Join` activity is not part of ActivityPub. Only `Follow` is.

Ah okay. Then I missunderstood

> ActivityPub uses [[ActivityStreams](https://www.w3.org/TR/activitypub/#bib-ActivityStreams)] for its vocabulary.

So when something is listed in [Activity Vocabulary](https://www.w3.org/TR/activitystreams-vocabulary/) but not listed in [ActivityPub](https://www.w3.org/TR/activitypub/) it’s not ActivityPub?

---

<div class="post-metadata">

**Author:** ![trwnh](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/trwnh/32/262_2.png) [@trwnh](https://socialhub.activitypub.rocks/u/trwnh)\
**Post date:** [May 27, 2024, 10:38am UTC](https://socialhub.activitypub.rocks/t/where-and-how-to-send-join-activity/4263/4 "2024-05-27T10:38:45Z")

</div>

> [@wobber](#):
>
> when something is listed in [Activity Vocabulary](https://www.w3.org/TR/activitystreams-vocabulary/) but not listed in [ActivityPub](https://www.w3.org/TR/activitypub/) it’s not ActivityPub?

ActivityPub refers to sending activities to the inbox/outbox in order to trigger certain side effects. It “uses AS2 for its vocabulary”, but that doesn’t mean that it uses _all_ of AS2. For example, if you receive a TentativeAccept of an Offer, that doesn’t have any defined side effects in ActivityPub, because ActivityPub only defines side effects for Create / Update / Delete / Follow / Like / Announce / Add / Remove, as well as for Accept Follow / Reject Follow / Undo Follow / Undo Like / Undo Block. These side effects are defined in Sections 6 and 7 of the ActivityPub spec. Some extensions also use the AS2 Vocabulary while defining new side effects for them; for example, [Mastodon defines some extensions using the AS2 vocab](https://docs.joinmastodon.org/spec/activitypub/#extensions-defined-using-activitystreams-vocabulary), such as Move for signaling account migrations and Flag for reporting objectionable content.
