Never filter out a user's own membership when using LL

This isn't normally a problem as generally the user will have just
joined the room and so will get included.

However, if rooms are being imported then we might send down the "new"
room without including the user's join event, confusing clients.
This commit is contained in:
Erik Johnston 2022-11-22 12:05:13 +00:00
parent 7ad87eace3
commit d0ff189166

View file

@ -588,7 +588,7 @@ func (p *PDUStreamProvider) lazyLoadMembers(
isGappedIncremental := limited && incremental
// We want this users membership event, keep it in the list
stateKey := *event.StateKey()
if _, ok := timelineUsers[stateKey]; ok || isGappedIncremental {
if _, ok := timelineUsers[stateKey]; ok || isGappedIncremental || stateKey == device.UserID {
newStateEvents = append(newStateEvents, event)
if !stateFilter.IncludeRedundantMembers {
p.lazyLoadCache.StoreLazyLoadedUser(device, roomID, stateKey, event.EventID())