Fix peeked rooms showing up in historical (#11316)

pull/28217/head
Michael Telatynski 2023-07-25 13:58:29 +01:00 committed by GitHub
parent b5cbd9eeca
commit c57a4cb090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -548,6 +548,8 @@ export class Algorithm extends EventEmitter {
const tags: TagID[] = []; const tags: TagID[] = [];
const membership = getEffectiveMembership(room.getMyMembership()); const membership = getEffectiveMembership(room.getMyMembership());
if (!membership) return []; // peeked room has no tags
if (membership === EffectiveMembership.Invite) { if (membership === EffectiveMembership.Invite) {
tags.push(DefaultTagID.Invite); tags.push(DefaultTagID.Invite);
} else if (membership === EffectiveMembership.Leave) { } else if (membership === EffectiveMembership.Leave) {

View File

@ -56,7 +56,11 @@ export function splitRoomsByMembership(rooms: Room[]): MembershipSplit {
}; };
for (const room of rooms) { for (const room of rooms) {
split[getEffectiveMembership(room.getMyMembership())].push(room); const membership = room.getMyMembership();
// Filter out falsey relationship as this will be peeked rooms
if (!!membership) {
split[getEffectiveMembership(membership)].push(room);
}
} }
return split; return split;