1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

use getRelation as getContent()[m.relates_to] doesn't work in e2ee rooms

This commit is contained in:
Bruno Windels
2019-11-18 18:31:39 +01:00
parent 180fea8ace
commit cd735ef459

View File

@@ -789,13 +789,9 @@ function verificationEventHandler(target, userId, roomId, eventId) {
|| event.getSender() !== userId) {
return;
}
const content = event.getContent();
if (!content["m.relates_to"]) {
return;
}
const relatesTo
= content["m.relationship"] || content["m.relates_to"];
if (!relatesTo.rel_type
const relatesTo = event.getRelation();
if (!relatesTo
|| !relatesTo.rel_type
|| relatesTo.rel_type !== "m.reference"
|| !relatesTo.event_id
|| relatesTo.event_id !== eventId) {