Fix DM logic to always pick a more reliable DM room

Fixes https://github.com/vector-im/element-web/issues/15605
This commit is contained in:
Travis Ralston 2020-11-13 15:19:34 -07:00
parent 8eadf6b183
commit 91b1c8b817
4 changed files with 29 additions and 20 deletions

View file

@ -78,6 +78,11 @@ export function getEffectiveMembership(membership: string): EffectiveMembership
}
}
export function isJoinedOrNearlyJoined(membership: string): boolean {
const effective = getEffectiveMembership(membership);
return effective === EffectiveMembership.Join || effective === EffectiveMembership.Invite;
}
export async function leaveRoomBehaviour(roomId: string) {
let leavingAllVersions = true;
const history = await MatrixClientPeg.get().getRoomUpgradeHistory(roomId);