Files
server/src/activitypub
2023-09-26 01:22:40 +10:00
..
2023-09-26 01:22:40 +10:00
2023-09-26 01:22:40 +10:00
2023-09-26 01:22:40 +10:00
2023-09-26 01:22:40 +10:00

Spacebar Activitypub

Supported Types

Spacebar object Activitypub
Message Note
Channel Group
Guild Organisation
User Person
Role Spacebar extension: Role

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.

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

User Federation

A person. Sends messages to Channels. May also create, modify, or moderate guilds, channels, or roles. Is a partOf a Role

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 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/

  • /.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