@@ -49,7 +49,6 @@ import VoipUserMapper from "./VoipUserMapper";
49
49
import { htmlSerializeFromMdIfNeeded } from "./editor/serialize" ;
50
50
import { leaveRoomBehaviour } from "./utils/leave-behaviour" ;
51
51
import { MatrixClientPeg } from "./MatrixClientPeg" ;
52
- import { getDeviceCryptoInfo } from "./utils/crypto/deviceInfo" ;
53
52
import { isCurrentLocalRoom , reject , singleMxcUpload , success , successSync } from "./slash-commands/utils" ;
54
53
import { deop , op } from "./slash-commands/op" ;
55
54
import { CommandCategories } from "./slash-commands/interface" ;
@@ -658,69 +657,6 @@ export const Commands = [
658
657
category : CommandCategories . admin ,
659
658
renderingTypes : [ TimelineRenderingType . Room ] ,
660
659
} ) ,
661
- new Command ( {
662
- command : "verify" ,
663
- args : "<user-id> <device-id> <device-signing-key>" ,
664
- description : _td ( "slash_command|verify" ) ,
665
- runFn : function ( cli , roomId , threadId , args ) {
666
- if ( args ) {
667
- const matches = args . match ( / ^ ( \S + ) + ( \S + ) + ( \S + ) $ / ) ;
668
- if ( matches ) {
669
- const userId = matches [ 1 ] ;
670
- const deviceId = matches [ 2 ] ;
671
- const fingerprint = matches [ 3 ] ;
672
-
673
- return success (
674
- ( async ( ) : Promise < void > => {
675
- const device = await getDeviceCryptoInfo ( cli , userId , deviceId ) ;
676
- if ( ! device ) {
677
- throw new UserFriendlyError ( "slash_command|verify_unknown_pair" , {
678
- userId,
679
- deviceId,
680
- cause : undefined ,
681
- } ) ;
682
- }
683
- const deviceTrust = await cli . getCrypto ( ) ?. getDeviceVerificationStatus ( userId , deviceId ) ;
684
-
685
- if ( deviceTrust ?. isVerified ( ) ) {
686
- if ( device . getFingerprint ( ) === fingerprint ) {
687
- throw new UserFriendlyError ( "slash_command|verify_nop" ) ;
688
- } else {
689
- throw new UserFriendlyError ( "slash_command|verify_nop_warning_mismatch" ) ;
690
- }
691
- }
692
-
693
- if ( device . getFingerprint ( ) !== fingerprint ) {
694
- const fprint = device . getFingerprint ( ) ;
695
- throw new UserFriendlyError ( "slash_command|verify_mismatch" , {
696
- fprint,
697
- userId,
698
- deviceId,
699
- fingerprint,
700
- cause : undefined ,
701
- } ) ;
702
- }
703
-
704
- await cli . setDeviceVerified ( userId , deviceId , true ) ;
705
-
706
- // Tell the user we verified everything
707
- Modal . createDialog ( InfoDialog , {
708
- title : _t ( "slash_command|verify_success_title" ) ,
709
- description : (
710
- < div >
711
- < p > { _t ( "slash_command|verify_success_description" , { userId, deviceId } ) } </ p >
712
- </ div >
713
- ) ,
714
- } ) ;
715
- } ) ( ) ,
716
- ) ;
717
- }
718
- }
719
- return reject ( this . getUsage ( ) ) ;
720
- } ,
721
- category : CommandCategories . advanced ,
722
- renderingTypes : [ TimelineRenderingType . Room ] ,
723
- } ) ,
724
660
new Command ( {
725
661
command : "discardsession" ,
726
662
description : _td ( "slash_command|discardsession" ) ,
0 commit comments