Skip to content

Commit

Permalink
Prevent join event spam with stable reason (#268)
Browse files Browse the repository at this point in the history
Fix #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 #262
  • Loading branch information
MadLittleMods authored Jun 22, 2023
1 parent c5debf4 commit aff0423
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions server/lib/matrix-utils/ensure-room-joined.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
},
Expand Down

0 comments on commit aff0423

Please sign in to comment.