add isTrackingMembers flag to know if EncryptionUsers have been written
for this room
This commit is contained in:
parent
d813e6d932
commit
8da00f9a03
2 changed files with 16 additions and 0 deletions
|
@ -260,6 +260,10 @@ export class Room extends EventEmitter {
|
||||||
return !!this._summary.encryption;
|
return !!this._summary.encryption;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isTrackingMembers() {
|
||||||
|
return this._summary.isTrackingMembers;
|
||||||
|
}
|
||||||
|
|
||||||
async _getLastEventId() {
|
async _getLastEventId() {
|
||||||
const lastKey = this._syncWriter.lastMessageKey;
|
const lastKey = this._syncWriter.lastMessageKey;
|
||||||
if (lastKey) {
|
if (lastKey) {
|
||||||
|
|
|
@ -147,6 +147,7 @@ class SummaryData {
|
||||||
this.heroes = copy ? copy.heroes : null;
|
this.heroes = copy ? copy.heroes : null;
|
||||||
this.canonicalAlias = copy ? copy.canonicalAlias : null;
|
this.canonicalAlias = copy ? copy.canonicalAlias : null;
|
||||||
this.hasFetchedMembers = copy ? copy.hasFetchedMembers : false;
|
this.hasFetchedMembers = copy ? copy.hasFetchedMembers : false;
|
||||||
|
this.isTrackingMembers = copy ? copy.isTrackingMembers : false;
|
||||||
this.lastPaginationToken = copy ? copy.lastPaginationToken : null;
|
this.lastPaginationToken = copy ? copy.lastPaginationToken : null;
|
||||||
this.avatarUrl = copy ? copy.avatarUrl : null;
|
this.avatarUrl = copy ? copy.avatarUrl : null;
|
||||||
this.notificationCount = copy ? copy.notificationCount : 0;
|
this.notificationCount = copy ? copy.notificationCount : 0;
|
||||||
|
@ -238,6 +239,10 @@ export class RoomSummary {
|
||||||
return this._data.hasFetchedMembers;
|
return this._data.hasFetchedMembers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isTrackingMembers() {
|
||||||
|
return this._data.isTrackingMembers;
|
||||||
|
}
|
||||||
|
|
||||||
get lastPaginationToken() {
|
get lastPaginationToken() {
|
||||||
return this._data.lastPaginationToken;
|
return this._data.lastPaginationToken;
|
||||||
}
|
}
|
||||||
|
@ -262,6 +267,13 @@ export class RoomSummary {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
writeIsTrackingMembers(value, txn) {
|
||||||
|
const data = new SummaryData(this._data);
|
||||||
|
data.isTrackingMembers = value;
|
||||||
|
txn.roomSummary.set(data.serialize());
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
writeSync(roomResponse, membership, isInitialSync, isTimelineOpen, txn) {
|
writeSync(roomResponse, membership, isInitialSync, isTimelineOpen, txn) {
|
||||||
// clear cloned flag, so cloneIfNeeded makes a copy and
|
// clear cloned flag, so cloneIfNeeded makes a copy and
|
||||||
// this._data is not modified if any field is changed.
|
// this._data is not modified if any field is changed.
|
||||||
|
|
Reference in a new issue