From aff0423f4cf77a3d2b80e846c69ad4c6731904c8 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Thu, 22 Jun 2023 01:55:21 -0500 Subject: [PATCH] Prevent join event spam with stable `reason` (#268) Fix https://github.com/matrix-org/matrix-public-archive/issues/267 In the case of someone visiting a room via an alias, we can't get access to the `room_id` before we join the room. I've opted to just point to the Matrix Public Archive instance in general. This way the `join` reason is always stable regardless how someone is visiting the room. Join `reason` was originally added in https://github.com/matrix-org/matrix-public-archive/pull/262 --- server/lib/matrix-utils/ensure-room-joined.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/server/lib/matrix-utils/ensure-room-joined.js b/server/lib/matrix-utils/ensure-room-joined.js index 09826f4..f192d76 100644 --- a/server/lib/matrix-utils/ensure-room-joined.js +++ b/server/lib/matrix-utils/ensure-room-joined.js @@ -52,12 +52,7 @@ async function ensureRoomJoined( reason: `Joining room to check history visibility. ` + `If your room is public with shared or world readable history visibility, ` + - `it will be accessible at ${matrixPublicArchiveURLCreator.archiveUrlForRoom( - roomIdOrAlias - // We don't need to include the `viaServers` option here because the archive - // will already be joined to the room from this request itself and we don't - // need to make the URL any longer/noisier than it needs to be. - )}. ` + + `it will be accessible on ${matrixPublicArchiveURLCreator.roomDirectoryUrl()}. ` + `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`, },