From d7f5252f9afa237841f9c78baac9ae33c91230b8 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 7 Nov 2019 17:43:50 +0100 Subject: [PATCH] render done and cancel event as conclusion tile don't render any done events not sent by us, as done events are sent by both parties and we don't want to render two conclusion tiles. cancel events should be only sent by one party. --- src/components/views/rooms/EventTile.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index fca77fcaf6..de13fa30e2 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -40,6 +40,8 @@ const ObjectUtils = require('../../../ObjectUtils'); const eventTileTypes = { 'm.room.message': 'messages.MessageEvent', 'm.sticker': 'messages.MessageEvent', + 'm.key.verification.cancel': 'messages.MKeyVerificationConclusion', + 'm.key.verification.done': 'messages.MKeyVerificationConclusion', 'm.call.invite': 'messages.TextualEvent', 'm.call.answer': 'messages.TextualEvent', 'm.call.hangup': 'messages.TextualEvent', @@ -84,6 +86,16 @@ function getHandlerTile(ev) { } } } + // these events are sent by both parties during verification, but we only want to render one + // tile once the verification concludes, so filter out the one from the other party. + if (type === "m.key.verification.done") { + const client = MatrixClientPeg.get(); + const me = client && client.getUserId(); + if (ev.getSender() !== me) { + return undefined; + } + } + return ev.isState() ? stateEventTileTypes[type] : eventTileTypes[type]; }