log room id in invite and archivedroom afterSync

This commit is contained in:
Bruno Windels 2021-05-11 13:05:02 +02:00
parent e775ed12b4
commit 24731687dc
3 changed files with 6 additions and 4 deletions

View file

@ -309,13 +309,13 @@ export class Sync {
_afterSync(sessionState, inviteStates, roomStates, archivedRoomStates, log) {
log.wrap("session", log => this._session.afterSync(sessionState.changes, log), log.level.Detail);
for(let ars of archivedRoomStates) {
log.wrap("archivedRoom", () => ars.archivedRoom.afterSync(ars.changes), log.level.Detail);
log.wrap("archivedRoom", log => ars.archivedRoom.afterSync(ars.changes, log), log.level.Detail);
}
for(let rs of roomStates) {
log.wrap("room", log => rs.room.afterSync(rs.changes, log), log.level.Detail);
}
for(let is of inviteStates) {
log.wrap("invite", () => is.invite.afterSync(is.changes), log.level.Detail);
log.wrap("invite", log => is.invite.afterSync(is.changes, log), log.level.Detail);
}
this._session.applyRoomCollectionChangesAfterSync(inviteStates, roomStates, archivedRoomStates);
}

View file

@ -73,7 +73,8 @@ export class ArchivedRoom extends BaseRoom {
* Called with the changes returned from `writeSync` to apply them and emit changes.
* No storage or network operations should be done here.
*/
afterSync({summaryData, kickDetails, kickAuthor}) {
afterSync({summaryData, kickDetails, kickAuthor}, log) {
log.set("id", this.id);
if (summaryData) {
this._summary.applyChanges(summaryData);
}

View file

@ -152,7 +152,8 @@ export class Invite extends EventEmitter {
}
}
afterSync(changes) {
afterSync(changes, log) {
log.set("id", this.id);
if (changes) {
if (changes.removed) {
this._accepting = false;