Kill off references to deprecated getStoredDevice and getStoredDevicesForUser (#11152)
* Use new `CryptoEvent.VerificationRequestReceived` event https://github.com/matrix-org/matrix-js-sdk/pull/3514 deprecates `CryptoEvent.VerificationRequest` in favour of `CryptoEvent.VerificationRequestReceived`. Use the new event. * Factor out `getDeviceCryptoInfo` function I seem to be writing this logic several times, so let's factor it out. * Factor out `getUserDeviceIds` function Another utility function * VerificationRequestToast: `getStoredDevice` -> `getDeviceCryptoInfo` * SlashCommands: `getStoredDevice` -> `getDeviceCryptoInfo` * MemberTile: `getStoredDevicesForUser` -> `getUserDeviceIds` * Remove redundant mock of `getStoredDevicesForUser`
This commit is contained in:
@@ -70,6 +70,7 @@ import { leaveRoomBehaviour } from "./utils/leave-behaviour";
|
||||
import { isLocalRoom } from "./utils/localRoom/isLocalRoom";
|
||||
import { SdkContextClass } from "./contexts/SDKContext";
|
||||
import { MatrixClientPeg } from "./MatrixClientPeg";
|
||||
import { getDeviceCryptoInfo } from "./utils/crypto/deviceInfo";
|
||||
|
||||
// XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816
|
||||
interface HTMLInputEvent extends Event {
|
||||
@@ -1031,7 +1032,7 @@ export const Commands = [
|
||||
|
||||
return success(
|
||||
(async (): Promise<void> => {
|
||||
const device = cli.getStoredDevice(userId, deviceId);
|
||||
const device = await getDeviceCryptoInfo(cli, userId, deviceId);
|
||||
if (!device) {
|
||||
throw new UserFriendlyError(
|
||||
"Unknown (user, session) pair: (%(userId)s, %(deviceId)s)",
|
||||
|
||||
Reference in New Issue
Block a user