mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-11 04:27:40 +01:00
emit events for rooms before invites
so the room is already there when removing the invite
This commit is contained in:
parent
b77d0f75ce
commit
b9f145caa4
@ -287,18 +287,19 @@ export class Sync {
|
|||||||
|
|
||||||
_afterSync(sessionState, inviteStates, roomStates, log) {
|
_afterSync(sessionState, inviteStates, roomStates, log) {
|
||||||
log.wrap("session", log => this._session.afterSync(sessionState.changes, log), log.level.Detail);
|
log.wrap("session", log => this._session.afterSync(sessionState.changes, log), log.level.Detail);
|
||||||
|
// emit room related events after txn has been closed
|
||||||
|
for(let rs of roomStates) {
|
||||||
|
log.wrap("room", log => rs.room.afterSync(rs.changes, log), log.level.Detail);
|
||||||
|
if (rs.isNewRoom) {
|
||||||
|
this._session.addRoomAfterSync(rs.room);
|
||||||
|
}
|
||||||
|
}
|
||||||
// emit invite related events after txn has been closed
|
// emit invite related events after txn has been closed
|
||||||
for(let is of inviteStates) {
|
for(let is of inviteStates) {
|
||||||
log.wrap("invite", () => is.invite.afterSync(is.changes), log.level.Detail);
|
log.wrap("invite", () => is.invite.afterSync(is.changes), log.level.Detail);
|
||||||
if (is.isNewInvite) {
|
if (is.isNewInvite) {
|
||||||
this._session.addInviteAfterSync(is.invite);
|
this._session.addInviteAfterSync(is.invite);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// emit room related events after txn has been closed
|
|
||||||
for(let rs of roomStates) {
|
|
||||||
log.wrap("room", log => rs.room.afterSync(rs.changes, log), log.level.Detail);
|
|
||||||
if (rs.isNewRoom) {
|
|
||||||
this._session.addRoomAfterSync(rs.room);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user