Skip to content

Note

このドキュメントは2026-02-27 03:23PLaMo Translation Modelを使用して自動翻訳されました。

FEP-1970: Chatリンク機能

概要

本FEPでは、ActivityPubのアクターおよびオブジェクトにチャットルームを関連付ける方法について説明します。 チャットルーム自体はウェブページ、XMPPルーム、Matrixルーム、IRCチャンネルなど、様々な形態を取り得ます。ただし、チャット自体が必ずActivityPubを使用してメッセージを公開する必要はありません。

チャットリンクの仕様

チャットリンクは以下のプロパティを持つオブジェクトとして定義されます:

  • type(必須): この値はLinkでなければなりません。
  • name(推奨): nameプロパティには、人間が読み取り可能な形でチャットリンクの内容を記述してください。
  • href(必須): hrefプロパティにはチャットルームのURIを指定します。これはウェブサイトのURLでも、XMPP URIなどの任意の形式のURIでも構いません。
  • rel(必須): relプロパティには、文字列discussionまたはその値を含む配列を指定してください。このdiscussion関係タイプは、HTML5リンクタイプ拡張仕様として提案されています。

チャットリンクは必ずアクターまたはオブジェクトのattachment配列に追加する必要があります。

使用例

基本的なオブジェクトへの添付例

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Article",
  "id": "https://example.tld/video/123",
  "attributedTo": "https://example.tld/users/alice",
  "name": "ライブ配信を開始しよう!",
  "attachment": [
    {
      "type": "Link",
      "name": "チャットルーム",
      "href": "https://example.tld/chat/room/123",
      "rel": "discussion"
    }
  ]
}

基本的なアクターへの添付例

{
  "@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": "チャットルーム",
      "href": "https://example.tld/chat/room/123",
      "rel": "discussion"
    }
  ]
}

複数の方法で参加可能なチャットルーム

以下の例では、ウェブブラウザまたはXMPPクライアントのいずれかを使用してチャットルームに参加できます:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Video",
  "id": "https://example.tld/video/123",
  "attributedTo": "https://example.tld/users/alice",
  "name": "ライブ配信を開始しよう!",
  "attachment": [
    {
      "type": "Link",
      "name": "チャットルーム",
      "href": "https://example.tld/chat/room/123",
      "rel": "discussion"
    },
    {
      "type": "Link",
      "name": "チャットルーム",
      "href": "xmpp://123@room.example.tld?join",
      "rel": "discussion"
    }
  ]
}

ライブ配信動画の場合

Videoオブジェクトで表現されるライブストリームの場合、チャットリンクは視聴者がストリーマーとやり取りできるルームへのリンクとして機能します。

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Video",
  "id": "https://example.tld/video/123",
  "attributedTo": "https://example.tld/users/alice",
  "name": "ライブ配信を開始しよう!",
  "attachment": [
    {
      "type": "Link",
      "name": "チャットルーム",
      "href": "https://example.tld/chat/room/123",
      "rel": "discussion"
    }
  ]
}

もしこのチャットルームがストリーマーごとに固有であり(かつすべてのストリーム動画で共通して使用される場合)、VideoオブジェクトとPersonオブジェクトの両方に関連付けることができます。

{
  "@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": "チャットルーム",
      "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": "ライブ配信を開始しよう!",
  "attachment": [
    {
      "type": "Link",
      "name": "チャットルーム",
      "href": "https://example.tld/chat/room/123",
      "rel": "discussion"
    }
  ]
}

もしこのチャットルームが特定のストリーマーチャンネルに固有である場合、VideoオブジェクトとGroupオブジェクトの両方にリンクさせることができます。

{
  "@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チャンネル",
  "attachment": [
    {
      "type": "Link",
      "name": "チャットルーム",
      "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": "ライブ配信を開始しよう!",
  "attachment": [
    {
      "type": "Link",
      "name": "チャットルーム",
      "href": "https://example.tld/chat/room/123",
      "rel": "discussion"
    }
  ]
}

ドキュメントディスカッションの場合

一部のファイル共有ソフトウェアでは、ファイルに関連付けられたディスカッションルームを作成できます。このようなケースでは、チャットリンクをDocumentオブジェクトの添付として追加することができます。

個人間インスタントメッセージングの場合

ユーザーがインスタントメッセージングアプリケーションを使用している場合、チャットリンクはそのPersonオブジェクトに追加することで、ユーザーとのやり取りが可能になります。

もしユーザーが複数のインスタントメッセージングアカウント(XMPP、Matrixなど)を持っている場合、それぞれのアカウントを個別に追加し、URIスキームによって区別することができます。

実装状況

本FEP執筆時点で、この機能はPeertubeライブチャットプラグインで実装されています。このプラグインはPeertube向けのチャット拡張機能です。

参考文献

著作権情報

CC0 1.0 Universal(パブリックドメイン献呈) 本Fediverse Enhancement Proposalの著者らは、法律の範囲内で可能な限り、すべての著作権および関連する権利を放棄しています。