feat: Add a way to get a verification request by its transaction id
A client might find the need to get the verification request object by its transaction id, to be able to e.g. display for in-room verification an "accept verification request" button easily.
This commit is contained in:
parent
86041513f8
commit
98b0bd4322
|
|
@ -52,6 +52,8 @@ class KeyVerificationManager {
|
|||
_requests[request.transactionId] = request;
|
||||
}
|
||||
|
||||
KeyVerification getRequest(String requestId) => _requests[requestId];
|
||||
|
||||
Future<void> handleToDeviceEvent(ToDeviceEvent event) async {
|
||||
if (!event.type.startsWith('m.key.verification.') ||
|
||||
client.verificationMethods.isEmpty) {
|
||||
|
|
|
|||
|
|
@ -128,6 +128,11 @@ void main() {
|
|||
await sub.cancel();
|
||||
expect(req2 != null, true);
|
||||
|
||||
expect(
|
||||
client2.encryption.keyVerificationManager
|
||||
.getRequest(req2.transactionId),
|
||||
req2);
|
||||
|
||||
// send ready
|
||||
FakeMatrixApi.calledEndpoints.clear();
|
||||
await req2.acceptVerification();
|
||||
|
|
|
|||
Loading…
Reference in New Issue