You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
checking the userid isn't a thing anymore AFAIK
This commit is contained in:
@@ -23,7 +23,6 @@ limitations under the License.
|
|||||||
import {VerificationBase as Base} from "./Base";
|
import {VerificationBase as Base} from "./Base";
|
||||||
import {
|
import {
|
||||||
newKeyMismatchError,
|
newKeyMismatchError,
|
||||||
newUserMismatchError,
|
|
||||||
} from './Error';
|
} from './Error';
|
||||||
import {decodeBase64} from "../olmlib";
|
import {decodeBase64} from "../olmlib";
|
||||||
|
|
||||||
@@ -50,23 +49,6 @@ export class ReciprocateQRCode extends Base {
|
|||||||
"with this method yet.");
|
"with this method yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetUserId = this.startEvent.getSender();
|
|
||||||
if (!this.userId) {
|
|
||||||
console.log("Asking to confirm user ID");
|
|
||||||
this.userId = await new Promise((resolve, reject) => {
|
|
||||||
this.emit("confirm_user_id", {
|
|
||||||
userId: targetUserId,
|
|
||||||
confirm: resolve, // takes a userId
|
|
||||||
cancel: () => reject(newUserMismatchError()),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else if (targetUserId !== this.userId) {
|
|
||||||
throw newUserMismatchError({
|
|
||||||
expected: this.userId,
|
|
||||||
actual: targetUserId,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.startEvent.getContent()['secret'] !== this.request.encodedSharedSecret) {
|
if (this.startEvent.getContent()['secret'] !== this.request.encodedSharedSecret) {
|
||||||
throw newKeyMismatchError();
|
throw newKeyMismatchError();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user