diff --git a/src/matrix/Sync.js b/src/matrix/Sync.js index 0fc10b84..35703589 100644 --- a/src/matrix/Sync.js +++ b/src/matrix/Sync.js @@ -322,11 +322,6 @@ export class Sync { if (is.isNewInvite) { this._session.addInviteAfterSync(is.invite); } - // if we haven't archived or forgotten the (left) room yet, - // notify there is an invite now, so we can update the UI - if (is.room) { - is.room.setInvite(is.invite); - } } } diff --git a/src/matrix/room/Room.js b/src/matrix/room/Room.js index 62431ef6..e234e0e4 100644 --- a/src/matrix/room/Room.js +++ b/src/matrix/room/Room.js @@ -54,7 +54,6 @@ export class Room extends EventEmitter { this._getSyncToken = getSyncToken; this._platform = platform; this._observedEvents = null; - this._invite = null; } async _eventIdsToEntries(eventIds, txn) { @@ -359,9 +358,6 @@ export class Room extends EventEmitter { } let emitChange = false; if (summaryChanges) { - if (summaryChanges.isNewJoin(this._summary.data)) { - this._invite = null; - } this._summary.applyChanges(summaryChanges); if (!this._summary.data.needsHeroes) { this._heroes = null; @@ -451,14 +447,6 @@ export class Room extends EventEmitter { } } - /** @internal */ - setInvite(invite) { - // called when an invite comes in for this room - // (e.g. when we're in membership leave and haven't been archived or forgotten yet) - this._invite = invite; - this._emitUpdate(); - } - /** @public */ sendEvent(eventType, content, attachments, log = null) { this._platform.logger.wrapOrRun(log, "send", log => { @@ -621,17 +609,6 @@ export class Room extends EventEmitter { return this._summary.data.membership; } - /** - * The invite for this room, if any. - * This will only be set if you've left a room, and - * don't archive or forget it, and then receive an invite - * for it again - * @return {Invite?} - */ - get invite() { - return this._invite; - } - enableSessionBackup(sessionBackup) { this._roomEncryption?.enableSessionBackup(sessionBackup); // TODO: do we really want to do this every time you open the app?