mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 12:52:24 +03:00
Cleanup remaining statekey usage for senderIDs (#3106)
This commit is contained in:
parent
832ccc32f6
commit
77d9e4e93d
62 changed files with 760 additions and 455 deletions
|
@ -605,13 +605,17 @@ func (p *PDUStreamProvider) lazyLoadMembers(
|
|||
// If this is a gapped incremental sync, we still want this membership
|
||||
isGappedIncremental := limited && incremental
|
||||
// We want this users membership event, keep it in the list
|
||||
stateKey := *event.StateKey()
|
||||
if _, ok := timelineUsers[stateKey]; ok || isGappedIncremental || stateKey == device.UserID {
|
||||
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)
|
||||
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 {
|
||||
newStateEvents = append(newStateEvents, event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue