matrix-rust-sdk
matrix-rust-sdk copied to clipboard
`SasState::Started` does not allow to know who started the SAS verification
The SasState::Started
state occurs when either party started the SAS verification. However it is important to know whether we started it, because, when we use SasVerification::changes
, if we receive the state and the other party started it, we need to accept it so the verification can continue.
I thought that's what SasVerification::we_started
was for, but it's actually the same value as VerificationRequest::we_started
, which is the party that sent the verification request, not the party that started the SAS verification. That makes sense if the use case is to drop VerificationRequest
when the SasVerification
starts and we want to keep the same API.
I am wondering which solution is more acceptable:
- Keep a boolean internally and expose it in a method, e.g.
SasVerification::we_started_sas()
. - Use different variants according to whether we or the other party started it. This is the solution in other cases were it matters who sent what:
VerificationRequestState::Created
vsVerificationRequestState::Requested
andQrVerificationState::Reciprocated
vsQrVerificationState::Scanned
.