11/*
2- Copyright 2019, 2020 The Matrix.org Foundation C.I.C.
2+ Copyright 2019, 2020, 2021 The Matrix.org Foundation C.I.C.
33
44Licensed under the Apache License, Version 2.0 (the "License");
55you may not use this file except in compliance with the License.
@@ -14,16 +14,19 @@ See the License for the specific language governing permissions and
1414limitations under the License.
1515*/
1616
17- import { MatrixClientPeg } from './MatrixClientPeg' ;
17+ import { User } from "matrix-js-sdk/src/models/user" ;
18+
19+ import { MatrixClientPeg } from './MatrixClientPeg' ;
1820import dis from "./dispatcher/dispatcher" ;
1921import Modal from './Modal' ;
2022import * as sdk from './index' ;
21- import { RightPanelPhases } from "./stores/RightPanelStorePhases" ;
22- import { findDMForUser } from './createRoom' ;
23- import { accessSecretStorage } from './SecurityManager' ;
24- import { verificationMethods } from 'matrix-js-sdk/src/crypto' ;
25- import { Action } from './dispatcher/actions' ;
23+ import { RightPanelPhases } from "./stores/RightPanelStorePhases" ;
24+ import { findDMForUser } from './createRoom' ;
25+ import { accessSecretStorage } from './SecurityManager' ;
26+ import { verificationMethods } from 'matrix-js-sdk/src/crypto' ;
27+ import { Action } from './dispatcher/actions' ;
2628import UntrustedDeviceDialog from "./components/views/dialogs/UntrustedDeviceDialog" ;
29+ import { IDevice } from "./components/views/right_panel/UserInfo" ;
2730
2831async function enable4SIfNeeded ( ) {
2932 const cli = MatrixClientPeg . get ( ) ;
@@ -39,7 +42,7 @@ async function enable4SIfNeeded() {
3942 return true ;
4043}
4144
42- export async function verifyDevice ( user , device ) {
45+ export async function verifyDevice ( user : User , device : IDevice ) {
4346 const cli = MatrixClientPeg . get ( ) ;
4447 if ( cli . isGuest ( ) ) {
4548 dis . dispatch ( { action : 'require_registration' } ) ;
@@ -82,7 +85,7 @@ export async function verifyDevice(user, device) {
8285 } ) ;
8386}
8487
85- export async function legacyVerifyUser ( user ) {
88+ export async function legacyVerifyUser ( user : User ) {
8689 const cli = MatrixClientPeg . get ( ) ;
8790 if ( cli . isGuest ( ) ) {
8891 dis . dispatch ( { action : 'require_registration' } ) ;
@@ -102,7 +105,7 @@ export async function legacyVerifyUser(user) {
102105 } ) ;
103106}
104107
105- export async function verifyUser ( user ) {
108+ export async function verifyUser ( user : User ) {
106109 const cli = MatrixClientPeg . get ( ) ;
107110 if ( cli . isGuest ( ) ) {
108111 dis . dispatch ( { action : 'require_registration' } ) ;
@@ -122,7 +125,7 @@ export async function verifyUser(user) {
122125 } ) ;
123126}
124127
125- export function pendingVerificationRequestForUser ( user ) {
128+ export function pendingVerificationRequestForUser ( user : User ) {
126129 const cli = MatrixClientPeg . get ( ) ;
127130 const dmRoom = findDMForUser ( cli , user . userId ) ;
128131 if ( dmRoom ) {
0 commit comments