Skip to content

Commit

Permalink
don't consider room invites that are ignored to be "visible"
Browse files Browse the repository at this point in the history
  • Loading branch information
jesopo committed Jul 7, 2022
1 parent 85a96c6 commit 9401b20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ import {
UNSTABLE_MSC3088_PURPOSE,
UNSTABLE_MSC3089_TREE_SUBTYPE,
} from "./@types/event";
import { IAbortablePromise, IdServerUnbindResult, IImageInfo, Preset, Visibility } from "./@types/partials";
import { IAbortablePromise, IdServerUnbindResult, IImageInfo, JoinRule, Preset, Visibility } from "./@types/partials";
import { EventMapper, eventMapperFor, MapperOpts } from "./event-mapper";
import { randomString } from "./randomstring";
import { BackupManager, IKeyBackup, IKeyBackupCheck, IPreparedKeyBackupVersion, TrustInfo } from "./crypto/backup";
Expand Down Expand Up @@ -3298,10 +3298,13 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
}
}

const ignoredInvites = new Set(this.getIgnoredInvites().ignored_rooms?.map(i => i.room_id) ?? []);
return allRooms.filter((r) => {
const tombstone = r.currentState.getStateEvents(EventType.RoomTombstone, '');
if (tombstone && replacedRooms.has(r.roomId)) {
return false;
} else if (r.getMyMembership() === JoinRule.Invite && ignoredInvites.has(r.roomId)) {
return false;
}
return true;
});
Expand Down

0 comments on commit 9401b20

Please sign in to comment.