Merge pull request #9802 from nordeck/widget_state_no_update_invitation_room

State event updates are not forwarded to the widget from invitation room
This commit is contained in:
Andy Balaam 2023-01-16 15:33:25 +00:00 committed by GitHub
commit 7af4891cb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 232 additions and 1 deletions

View file

@ -519,7 +519,17 @@ export class StopGapWidget extends EventEmitter {
}
}
this.readUpToMap[ev.getRoomId()] = ev.getId();
// Skip marker assignment if membership is 'invite', otherwise 'm.room.member' from
// invitation room will assign it and new state events will be not forwarded to the widget
// because of empty timeline for invitation room and assigned marker.
const evRoomId = ev.getRoomId();
const evId = ev.getId();
if (evRoomId && evId) {
const room = this.client.getRoom(evRoomId);
if (room && room.getMyMembership() === "join") {
this.readUpToMap[evRoomId] = evId;
}
}
const raw = ev.getEffectiveEvent();
this.messaging.feedEvent(raw as IRoomEvent, this.eventListenerRoomId).catch((e) => {