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 14:19:08 +00:00
committed by GitHub
parent d7bb8043ea
commit db40479910
3 changed files with 15 additions and 11 deletions
+4 -1
View File
@@ -397,7 +397,10 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
*/
export async function canEncryptToAllUsers(client: MatrixClient, userIds: string[]): Promise<boolean> {
try {
const usersDeviceMap = await client.downloadKeys(userIds);
const usersDeviceMap = await client.getCrypto()?.getUserDeviceInfo(userIds, true);
if (!usersDeviceMap) {
return false;
}
for (const devices of usersDeviceMap.values()) {
if (devices.size === 0) {