1
0
mirror of https://codeberg.org/fediverse/fep.git synced 2026-08-05 19:55:46 +00:00

FEP-1970: Chat Links (#122)

This FEP describes a way to attach a chat room to [ActivityPub](https://www.w3.org/TR/activitypub/) actors and objects.
The chat room itself can be a web page, a XMPP room, a Matrix room, an IRC channel, ...

Co-authored-by: John Livingston <git@john-livingston.fr>
Reviewed-on: https://codeberg.org/fediverse/fep/pulls/122
Co-authored-by: John Livingston <john_livingston@noreply.codeberg.org>
Co-committed-by: John Livingston <john_livingston@noreply.codeberg.org>
This commit is contained in:
John Livingston
2023-07-09 06:51:11 +00:00
committed by helge
parent 61af68bbdf
commit 4ac66d97b3
+214
View File
@@ -0,0 +1,214 @@
---
slug: "1970"
authors: John Livingston <git@john-livingston.fr>
status: DRAFT
dateReceived: 2023-07-04
---
# FEP-1970: Chat Links
## Summary
This FEP describes a way to attach a chat room to [ActivityPub](https://www.w3.org/TR/activitypub/) actors and objects.
The chat room itself can be a web page, a XMPP room, a Matrix room, an IRC channel, ... The chat itself does not necessarily publish messages using ActivityPub.
## Chat links
Chat link is an object with the following properties:
- `type` (REQUIRED): the type MUST be `Link`.
- `name` (RECOMMENDED): the `name` property SHOULD contain a human-readable description of the chat link.
- `href` (REQUIRED): the `href` property MUST contain a chat URI. This can be an URL of a website, or any other kind of [URI](https://datatracker.ietf.org/doc/rfc3986), such as a [XMPP uri](https://datatracker.ietf.org/doc/rfc5122/).
- `rel` (REQUIRED): the `rel` property MUST contain the string `discussion` or an array containing that string. The `discussion` relation type is proposed as a [HTML5 link type extensions](https://microformats.org/wiki/rel-discussion).
Chat links MUST be added to the `attachment` array of an actor or an object.
## Examples
### Basic object attachment
```json
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Article",
"id": "https://example.tld/video/123",
"attributedTo": "https://example.tld/users/alice",
"name": "Let's go live!",
"attachment": [
{
"type": "Link",
"name": "Chat",
"href": "https://example.tld/chat/room/123",
"rel": "discussion"
}
]
}
```
### Basic actor attachment
```json
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Person",
"id": "https://example.tld/users/alice",
"inbox": "https://example.tld/users/alice/inbox",
"outbox": "https://example.tld/users/alice/outbox",
"attachment": [
{
"type": "Link",
"name": "Chat",
"href": "https://example.tld/chat/room/123",
"rel": "discussion"
}
]
}
```
### Multiple way to join the chat
In the following example, the chat room can be joined using a web browser or a xmpp client:
```json
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Video",
"id": "https://example.tld/video/123",
"attributedTo": "https://example.tld/users/alice",
"name": "Let's go live!",
"attachment": [
{
"type": "Link",
"name": "Chat",
"href": "https://example.tld/chat/room/123",
"rel": "discussion"
},
{
"type": "Link",
"name": "Chat",
"href": "xmpp://123@room.example.tld?join",
"rel": "discussion"
}
]
}
```
### Live video stream
For a live stream, represented by a [Video](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-video) object, the chat link could link to the room where viewers can interract with the streamer.
```json
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Video",
"id": "https://example.tld/video/123",
"attributedTo": "https://example.tld/users/alice",
"name": "Let's go live!",
"attachment": [
{
"type": "Link",
"name": "Chat",
"href": "https://example.tld/chat/room/123",
"rel": "discussion"
}
]
}
```
If the chat room is unique per streamer (and common to all the streamer videos), it can be attached to both the Video and the [Person](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person) object.
```json
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Person",
"id": "https://example.tld/users/alice",
"following": "https://example.tld/users/alice/following",
"followers": "https://example.tld/users/alice/followers",
"name": "Alice",
"attachment": [
{
"type": "Link",
"name": "Chat",
"href": "https://example.tld/chat/room/123",
"rel": "discussion"
}
]
}
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Video",
"id": "https://example.tld/video/123",
"attributedTo": "https://example.tld/users/alice",
"name": "Let's go live!",
"attachment": [
{
"type": "Link",
"name": "Chat",
"href": "https://example.tld/chat/room/123",
"rel": "discussion"
}
]
}
```
If the chat room is unique to a streamer's channel, it can be linked to both the Video and the [Group](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-group) object.
```json
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Group",
"id": "https://example.tld/channel/alice",
"following": "https://example.tld/users/alice/following",
"followers": "https://example.tld/users/alice/followers",
"name": "Alice channel",
"attachment": [
{
"type": "Link",
"name": "Chat",
"href": "https://example.tld/chat/room/123",
"rel": "discussion"
}
]
}
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Video",
"id": "https://example.tld/video/123",
"attributedTo": "https://example.tld/users/alice",
"name": "Let's go live!",
"attachment": [
{
"type": "Link",
"name": "Chat",
"href": "https://example.tld/chat/room/123",
"rel": "discussion"
}
]
}
```
### Document discussion
Some file sharing sofwares allows to have a discussion room attached to files. In such case, the chat links can be added as attachment to [Document](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-document) objects.
### Person instant messaging
If a user has instant messaging applications, chat links could be added to its [Person](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person) object, so that we can join him.
If the user has multiple instant messaging accounts (XMPP, Matrix, ...), each on of them can be added, and differenciated by the URI scheme.
## Implementations
At the time of the writing, this FEP is been implemented in the [Peertube livechat plugin](https://github.com/JohnXLivingston/peertube-plugin-livechat/), a chat plugin for [Peertube](https://joinpeertube.org/).
## References
- [ActivityPub] Christine Lemmer Webber, Jessica Tallon, [ActivityPub](https://www.w3.org/TR/activitypub/), 2018
- [Microformats existing rel values] [Microformats existing rel values](https://microformats.org/wiki/existing-rel-values), referenced by the [HTML Living Standard](https://html.spec.whatwg.org/multipage/links.html#other-link-types).
## Copyright
CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
To the extent possible under law, the authors of this Fediverse Enhancement Proposal have waived all copyright and related or neighboring rights to this work.