From 18ba5f6f19b9b81894a7db823a760be3c2523d3d Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 10 Jan 2019 14:44:19 -0700 Subject: [PATCH] Don't show rooms with tombstones in the address picker Fixes https://github.com/vector-im/riot-web/issues/8076 --- src/components/views/dialogs/AddressPickerDialog.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js index cbe80763a6..6276a45839 100644 --- a/src/components/views/dialogs/AddressPickerDialog.js +++ b/src/components/views/dialogs/AddressPickerDialog.js @@ -389,6 +389,17 @@ module.exports = React.createClass({ const suggestedList = []; results.forEach((result) => { if (result.room_id) { + const client = MatrixClientPeg.get(); + const room = client.getRoom(result.room_id); + if (room) { + const tombstone = room.currentState.getStateEvents('m.room.tombstone', ''); + if (tombstone && tombstone.getContent() && tombstone.getContent()["replacement_room"]) { + const replacementRoom = client.getRoom(tombstone.getContent()["replacement_room"]); + + // Skip rooms with tombstones where we are also aware of the replacement room. + if (replacementRoom) return; + } + } suggestedList.push({ addressType: 'mx-room-id', address: result.room_id,