continueVerification method
Once you get a ready event, i.e both sides are in a askChoice
state,
send either m.reciprocate.v1
or m.sas.v1
here. If you continue with
qr, send the qrData you just scanned
Implementation
Future<void> continueVerification(
String type, {
Uint8List? qrDataRawBytes,
}) async {
bool qrChecksOut = false;
if (possibleMethods.contains(type)) {
if (qrDataRawBytes != null) {
qrChecksOut = await verifyQrData(qrDataRawBytes);
// after this scanners state is done
}
if (type != EventTypes.Reciprocate || qrChecksOut) {
final method = _method = _makeVerificationMethod(type, this);
await method.sendStart();
if (type == EventTypes.Sas) {
setState(KeyVerificationState.waitingAccept);
}
} else if (type == EventTypes.Reciprocate && !qrChecksOut) {
Logs().e('[KeyVerification] qr did not check out');
await cancel('m.invalid_key');
}
} else {
Logs().e(
'[KeyVerification] tried to continue verification with a unknown method',
);
await cancel('m.unknown_method');
}
}