From f05ece64dc8f0382c2f4549036b1afe789807e2d Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 5 Jun 2023 22:19:51 -0500 Subject: [PATCH] Add reason why the archive bot is joining the room Using the join `reason` added in MSC2367 Related to adding some better profile information, https://github.com/matrix-org/matrix-public-archive/issues/257#issuecomment-1570795922 --- docs/faq.md | 2 ++ server/lib/matrix-utils/ensure-room-joined.js | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/docs/faq.md b/docs/faq.md index fb5a827..ba446b1 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -17,6 +17,8 @@ And with the introduction of the jump to date API via [MSC3030](https://github.com/matrix-org/matrix-spec-proposals/pull/3030), we could show messages from any given date and day-by-day navigation. +## Why did the archive bot join my room? + ## How do I opt out and keep my room from being indexed by search engines? All public Matrix rooms are accessible to view in the Matrix Public Archive. But only diff --git a/server/lib/matrix-utils/ensure-room-joined.js b/server/lib/matrix-utils/ensure-room-joined.js index fc92536..aa7af3a 100644 --- a/server/lib/matrix-utils/ensure-room-joined.js +++ b/server/lib/matrix-utils/ensure-room-joined.js @@ -43,6 +43,14 @@ async function ensureRoomJoined( method: 'POST', accessToken, abortSignal, + body: { + reason: + `Joining room to check history visibility. ` + + `If your room is public with shared or world readable history visibility, ` + + `it will be accessible at archive.matrix.org. ` + + `See the FAQ for more details: ` + + `https://github.com/matrix-org/matrix-public-archive/blob/main/docs/faq.md#why-did-the-archive-bot-join-my-room`, + }, }); assert( joinData.room_id,