From 9d67fa9fa185ded789cedb0abbdf7943d7c58f63 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 7 Nov 2019 17:42:06 +0100 Subject: [PATCH] render verification request with correct tile only if the request was send by or to us, otherwise ignore. --- src/components/views/rooms/EventTile.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 9497324f5a..fca77fcaf6 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -33,6 +33,7 @@ import dis from '../../../dispatcher'; import SettingsStore from "../../../settings/SettingsStore"; import {EventStatus, MatrixClient} from 'matrix-js-sdk'; import {formatTime} from "../../../DateUtils"; +import MatrixClientPeg from '../../../MatrixClientPeg'; const ObjectUtils = require('../../../ObjectUtils'); @@ -68,6 +69,21 @@ const stateEventTileTypes = { function getHandlerTile(ev) { const type = ev.getType(); + + // don't show verification requests we're not involved in, + // not even when showing hidden events + if (type === "m.room.message") { + const content = ev.getContent(); + if (content && content.msgtype === "m.key.verification.request") { + const client = MatrixClientPeg.get(); + const me = client && client.getUserId(); + if (ev.getSender() !== me && content.to !== me) { + return undefined; + } else { + return "messages.MKeyVerificationRequest"; + } + } + } return ev.isState() ? stateEventTileTypes[type] : eventTileTypes[type]; }