Element-R: Starting a DMs with a user (#10673)

* Use `cli.getUserDeviceInfo` instead of `cli.downloadKeys` to create a room

* Use `client.getCrypto().getUserDeviceInfo` instead of `client.getUserDeviceInfo`

* Update `createRoom-test.ts` to use `getUserDeviceInfo`

* Remove duplicate  field
This commit is contained in:
Florian Duros 2023-04-24 16:19:08 +02:00 committed by GitHub
parent d7bb8043ea
commit db40479910
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 11 deletions

View file

@ -120,6 +120,7 @@ export function createTestClient(): MatrixClient {
downloadKeys: jest.fn(),
},
},
getCrypto: jest.fn().mockReturnValue({ getUserDeviceInfo: jest.fn() }),
getPushActionsForEvent: jest.fn(),
getRoom: jest.fn().mockImplementation((roomId) => mkStubRoom(roomId, "My room", client)),
@ -233,7 +234,6 @@ export function createTestClient(): MatrixClient {
}),
searchUserDirectory: jest.fn().mockResolvedValue({ limited: false, results: [] }),
getCrypto: jest.fn(),
} as unknown as MatrixClient;
client.reEmitter = new ReEmitter(client);