File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
crates/matrix-sdk/src/encryption/verification Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 13
13
// limitations under the License.
14
14
15
15
use matrix_sdk_base:: crypto:: { AcceptSettings , CancelInfo , ReadOnlyDevice , Sas as BaseSas } ;
16
- use ruma:: UserId ;
16
+ use ruma:: { events :: key :: verification :: cancel :: CancelCode , UserId } ;
17
17
18
18
use crate :: { error:: Result , Client } ;
19
19
@@ -89,6 +89,16 @@ impl SasVerification {
89
89
Ok ( ( ) )
90
90
}
91
91
92
+ /// Cancel the interactive verification flow because the short auth strings didn't match on both sides.
93
+ pub async fn mismatch ( & self ) -> Result < ( ) > {
94
+ // FIXME: Use variant once https://github.com/ruma/ruma/pull/804 is merged
95
+ if let Some ( request) = self . inner . cancel_with_code ( CancelCode :: from ( "m.mismatched_sas" ) ) {
96
+ self . client . send_verification_request ( request) . await ?;
97
+ }
98
+
99
+ Ok ( ( ) )
100
+ }
101
+
92
102
/// Cancel the interactive verification flow.
93
103
pub async fn cancel ( & self ) -> Result < ( ) > {
94
104
if let Some ( request) = self . inner . cancel ( ) {
You can’t perform that action at this time.
0 commit comments