with room status being a thing, we don't need the invite on the room

This commit is contained in:
Bruno Windels 2021-05-07 14:42:29 +02:00
parent a8d4ee0dd6
commit 06868abdb2
2 changed files with 0 additions and 28 deletions

View file

@ -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);
}
}
}

View file

@ -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?