You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-01 04:43:29 +03:00
Merge pull request #1248 from matrix-org/bwindels/removecryptoverifstartevent
Cleanup: remove crypto.verification.start event
This commit is contained in:
@@ -122,8 +122,8 @@ describe("SAS verification", function() {
|
||||
bobSasEvent = null;
|
||||
|
||||
bobPromise = new Promise((resolve, reject) => {
|
||||
bob.client.on("crypto.verification.start", (verifier) => {
|
||||
verifier.on("show_sas", (e) => {
|
||||
bob.client.on("crypto.verification.request", request => {
|
||||
request.verifier.on("show_sas", (e) => {
|
||||
if (!e.sas.emoji || !e.sas.decimal) {
|
||||
e.cancel();
|
||||
} else if (!aliceSasEvent) {
|
||||
@@ -139,7 +139,7 @@ describe("SAS verification", function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
resolve(verifier);
|
||||
resolve(request.verifier);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -339,11 +339,11 @@ describe("SAS verification", function() {
|
||||
};
|
||||
|
||||
const bobPromise = new Promise((resolve, reject) => {
|
||||
bob.client.on("crypto.verification.start", (verifier) => {
|
||||
verifier.on("show_sas", (e) => {
|
||||
bob.client.on("crypto.verification.request", request => {
|
||||
request.verifier.on("show_sas", (e) => {
|
||||
e.mismatch();
|
||||
});
|
||||
resolve(verifier);
|
||||
resolve(request.verifier);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -5506,13 +5506,6 @@ MatrixClient.prototype.generateClientSecret = function() {
|
||||
* reject the key verification.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fires when a key verification started message is received.
|
||||
* @event module:client~MatrixClient#"crypto.verification.start"
|
||||
* @param {module:crypto/verification/Base} verifier a verifier object to
|
||||
* perform the key verification
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fires when a secret request has been cancelled. If the client is prompting
|
||||
* the user to ask whether they want to share a secret, the prompt can be
|
||||
|
||||
@@ -2680,12 +2680,7 @@ Crypto.prototype._handleVerificationEvent = async function(
|
||||
}
|
||||
event.setVerificationRequest(request);
|
||||
try {
|
||||
const hadVerifier = !!request.verifier;
|
||||
await request.channel.handleEvent(event, request, isLiveEvent);
|
||||
// emit start event when verifier got set
|
||||
if (!hadVerifier && request.verifier) {
|
||||
this._baseApis.emit("crypto.verification.start", request.verifier);
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error("error while handling verification event: " + err.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user