FEP-1970: Chat Links

Warning

このFEPはまだ翻訳されていません。

ここから翻訳に協力することができます。

Summary

This FEP describes a way to attach a chat room to 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 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, such as a XMPP uri.
  • 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.

Chat links MUST be added to the attachment array of an actor or an object.

Basic object attachment

{
  "@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

{
  "@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:

{
  "@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 object, the chat link could link to the room where viewers can interract with the streamer.

{
  "@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 object.

{
  "@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 object.

{
  "@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 objects.

Person instant messaging

If a user has instant messaging applications, chat links could be added to its 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.

実装

At the time of the writing, this FEP is been implemented in the Peertube livechat plugin, a chat plugin for Peertube.

参考文献

著作権

CC0 1.0 ユニバーサル (CC0 1.0) パブリック ドメイン

法律で認められる範囲において、この Fediverse 拡張提案の著者は、この作品に対するすべての著作権および関連する権利または隣接する権利を放棄しています。