1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
# Spacebar Activitypub
## Activitypub Specification
- [Activitystreams vocab](https://www.w3.org/TR/activitystreams-vocabulary)
- [Activitystreams](https://www.w3.org/TR/activitystreams-core)
- [Activitypub spec](https://www.w3.org/TR/activitypub/)
## Additional resources
- [Activitypub as it has been understood](https://flak.tedunangst.com/post/ActivityPub-as-it-has-been-understood)
- [Guide for new ActivityPub implementers](https://socialhub.activitypub.rocks/t/guide-for-new-activitypub-implementers/479)
- Understanding activitypub
[part 1](https://seb.jambor.dev/posts/understanding-activitypub/),
[part 2](https://seb.jambor.dev/posts/understanding-activitypub-part-2-lemmy/),
[part 3](https://seb.jambor.dev/posts/understanding-activitypub-part-3-the-state-of-mastodon/)
- [Nodejs Express Activitypub sample implementation](https://github.com/dariusk/express-activitypub)
- [Reading Activitypub](https://tinysubversions.com/notes/reading-activitypub/#the-ultimate-tl-dr)
# Spacebar Activitypub Docs
Incomplete documentation.
## Supported Types
| Spacebar object | Activitypub |
| --------------- | ---------------------------------------------------------------------------------- |
| Message | [Note](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-note) |
| Channel | [Group](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-group) |
| Guild | [Organisation](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-organization) |
| User | [Person](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person) |
| Role | Spacebar extension: [Role](#role-federation) |
## Message Federation
A message sent by a user. Sent to channels, or directly to users (a DM channel is created on Spacebar instances).
### Supported Activities
| Activity | Action |
| ---------- | ---------------------------------------------------- |
| `Create` | Transformed from a Note to a Message and saved to db |
| `Delete` | Removes a message from db |
| `Update` | Updates a message and saves to db. |
| `Announce` | Used by Channels to forward to members. |
### Properties Used
| Property | Description |
| ---------------------- | ---------------------------------------------------------------------------- |
| `type` | Must be `"Note"` |
| `content` | Message content |
| `name` | Used as message content if `content` not provided |
| `inReplyTo` | Reference a previous Message in this guild |
| `published` | Timestamp of this Message |
| `attributedTo` | Message author |
| `to` | The Channel this Message is a part of |
| `tag` | Mentions |
| `tag[].type` | Must be `Mention` |
| `tag[].name` | Plain-type Webfinger address of a Profile within this Guild OR `@everyone` |
| `attachment` | Message attachments |
| `attachment[].url` | The URL of this media attachment |
| `attachment[].summary` | The content warning for this media attachment |
| `replies` | For compatibility with other software: The replies to this message |
| `sbType` | Spacebar extension. Describes the real MessageType. i.e. `GUILD_MEMBER_JOIN` |
| `embeds` | Spacebar extension. Describes the attached Embeds |
| `flags` | Spacebar extension. Message flags as bitfield |
| TODO: reactions | How does plemora/akkoma/misskey/etc handle reactions? |
| TODO: components | |
| TODO: stickers | |
## Channel Federation
An automated actor. Users can send messages to it, which the channel forwards to it's followers in an `Announce`.
Follows/is followed by it's corresponding Guild, if applicable.
### Supported Activities
| Activity | Action |
| -------------- | ----------------------------------------------------- |
| `Create` | Transformed from a Group to a Channel and saved to db |
| `Delete` | Removes a channel from db |
| `Update` | Updates channel details |
| `Add`/`Remove` | Manage pinned Messages for this Channel |
### Properties Used
| Property | Description |
| -------------- | --------------------------------------------------------------------- |
| `type` | Must be `"Group"` |
| `name` | The Channel name |
| `published` | Creation timestamp of this Channel |
| `attributedTo` | The Guild this Channel is a part of |
| `featured` | Mastodon extension. The pinned Messages in this Channel |
| `publicKey` | The public key used to verify signatures from this actor |
| `sbType` | Spacebar extension. Describes the real ChannelType. i.e. `GUILD_TEXT` |
## Guild Federation
An automated actor. Follows and is followed by it's corresponding Channels.
Also contains a collection of [roles](#role-federation).
### Supported Activities
| Activity | Action |
| -------- | ------------------------------------------------------------------ |
| `Follow` | Join a guild. Must provide an invite code. Automatically accepted. |
| `Delete` | Delete a guild. |
| `Update` | Update guild details. |
### Properties Used
- attributed to is owner
## User Federation
A person. Sends messages to Channels. May also create, modify, or moderate guilds, channels, or roles.
Is a partOf a [Role](#role-federation)
### Supported Activities
| Activity | Action |
| ----------------- | ---------------------------------------------------------------------------------------------- |
| `Follow` | Send a friend request |
| `Accept`/`Reject` | Accept or reject a friend request |
| `Undo` | Unfriend |
| `Delete` | Delete a user from the database along with all their messages. |
| `Block` | Signal to the remote server that they should hide your profile from that user. Not guaranteed. |
| `Update` | Update user details. |
## Role Federation
Is a [Collection](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-collection) of Users within this role.
## S2S endpoints
Base url: `/federation`
- `/.well-known/webfinger?resource=acct@domain` - Returns webfinger response i.e. https://docs.joinmastodon.org/spec/webfinger/
- - Webfinger resources include users, channels, guilds, as well as invite codes which returns a the corresponding guild
- `/.well-known/host-meta` - Returns location of webfinger? Why is this neccessary?
- `/channels/:channel_id` - Returns specified Channel as AP object ( Group )
- `/channels/:channel_id/inbox` - The inbox for this Channel
- `/channels/:channel_id/outbox` - The outbox for this Channel
- `/channels/:channel_id/followers` - The Users that have access to this Channel
- `/channels/:channel_id/messages/:message_id` - Returns specified Message in Channel as AP object ( Announce Note )
-
- `/messages/:message_id` - Returns specified Message in Channel as AP object ( Announce Note )
- `/activities/:activity_id` - Returns the specified activitypub activity. E.g. Announce, Follow, etc.
- `/activities/inbox` - Shared inbox.
- `/users/:user_id` - Returns specified User as AP object (Person)
- `/users/:user_id/inbox` - The inbox of this User. POSTing creates a DM channel if it does not exist.
- `/guilds/:guild_id` - Returns specified Guild as AP object (Organisation)
## notes
- activitypub responses should be returned if the Accept header is `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` OR `application/activity+json`
|