set verification request on event
This commit is contained in:
@@ -2503,6 +2503,7 @@ Crypto.prototype._handleVerificationEvent = async function(
|
||||
if (!request) {
|
||||
return;
|
||||
}
|
||||
event.setVerificationRequest(request);
|
||||
isNewRequest = true;
|
||||
if (!requestsByTxnId) {
|
||||
requestsByTxnId = new Map();
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user