mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
render verification request with correct tile
only if the request was send by or to us, otherwise ignore.
This commit is contained in:
parent
e8c21a341c
commit
9d67fa9fa1
@ -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];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user