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:
parent
d7bb8043ea
commit
db40479910
3 changed files with 15 additions and 11 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue