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:
+4
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user