set verification request on event

This commit is contained in:
Bruno Windels
2019-12-10 12:13:26 +01:00
parent 4c6dd564a4
commit cd7cc1b71f
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -2503,6 +2503,7 @@ Crypto.prototype._handleVerificationEvent = async function(
if (!request) {
return;
}
event.setVerificationRequest(request);
isNewRequest = true;
if (!requestsByTxnId) {
requestsByTxnId = new Map();
+10
View File
@@ -155,6 +155,12 @@ module.exports.MatrixEvent = function MatrixEvent(
* attempt may succeed)
*/
this._retryDecryption = false;
/* If the event is a `m.key.verification.request` (or to_device `m.key.verification.start`) event,
* `Crypto` will set this the `VerificationRequest` for the event
* so it can be easily accessed from the timeline.
*/
this.verificationRequest = null;
};
utils.inherits(module.exports.MatrixEvent, EventEmitter);
@@ -1055,6 +1061,10 @@ utils.extend(module.exports.MatrixEvent.prototype, {
encrypted: this.event,
};
},
setVerificationRequest: function(request) {
this.verificationRequest = request;
},
});