mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-15 01:53:09 -06:00
Fix statekey usage in syncapi/stream_pdu
This commit is contained in:
parent
a7113dc8a6
commit
12375bb026
|
|
@ -605,13 +605,17 @@ func (p *PDUStreamProvider) lazyLoadMembers(
|
||||||
// If this is a gapped incremental sync, we still want this membership
|
// If this is a gapped incremental sync, we still want this membership
|
||||||
isGappedIncremental := limited && incremental
|
isGappedIncremental := limited && incremental
|
||||||
// We want this users membership event, keep it in the list
|
// We want this users membership event, keep it in the list
|
||||||
stateKey := *event.StateKey()
|
userID := ""
|
||||||
if _, ok := timelineUsers[stateKey]; ok || isGappedIncremental || stateKey == device.UserID {
|
stateKeyUserID, err := p.rsAPI.QueryUserIDForSender(ctx, roomID, spec.SenderID(*event.StateKey()))
|
||||||
|
if err == nil && stateKeyUserID != nil {
|
||||||
|
userID = stateKeyUserID.String()
|
||||||
|
}
|
||||||
|
if _, ok := timelineUsers[userID]; ok || isGappedIncremental || userID == device.UserID {
|
||||||
newStateEvents = append(newStateEvents, event)
|
newStateEvents = append(newStateEvents, event)
|
||||||
if !stateFilter.IncludeRedundantMembers {
|
if !stateFilter.IncludeRedundantMembers {
|
||||||
p.lazyLoadCache.StoreLazyLoadedUser(device, roomID, stateKey, event.EventID())
|
p.lazyLoadCache.StoreLazyLoadedUser(device, roomID, userID, event.EventID())
|
||||||
}
|
}
|
||||||
delete(timelineUsers, stateKey)
|
delete(timelineUsers, userID)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
newStateEvents = append(newStateEvents, event)
|
newStateEvents = append(newStateEvents, event)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue