Examine all m.direct rooms to find a DM as fallback (#10127)
This commit is contained in:
parent
1c6b06bb58
commit
a6eee32c66
7 changed files with 147 additions and 32 deletions
|
@ -29,7 +29,7 @@ import { findDMForUser } from "./findDMForUser";
|
|||
*/
|
||||
export function findDMRoom(client: MatrixClient, targets: Member[]): Room | null {
|
||||
const targetIds = targets.map((t) => t.userId);
|
||||
let existingRoom: Room;
|
||||
let existingRoom: Room | undefined;
|
||||
if (targetIds.length === 1) {
|
||||
existingRoom = findDMForUser(client, targetIds[0]);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue