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

add m.relates_to back to the content on the requesting side for e2e room

as it needs to be added to the commitment hash
as before, getContent() in an e2ee room doesn't return the relation
This commit is contained in:
Bruno Windels
2019-11-18 18:34:05 +01:00
parent 24ae787736
commit 3b02b62ba5
2 changed files with 15 additions and 1 deletions

View File

@@ -106,6 +106,17 @@ export default class VerificationBase extends EventEmitter {
}
}
_contentFromEventWithTxnId(event) {
if (this.roomId) { // verification as timeline event
// ensure m.related_to is included in e2ee rooms
// as the field is excluded from encryption
const content = Object.assign({}, event.getContent());
content["m.relates_to"] = event.getRelation();
return content;
} else { // verification as to_device event
return event.getContent();
}
}
/* creates a content object with the transaction id added to it */
_contentWithTxnId(content) {