mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 21:02:25 +03:00
Move pseudoID ClientEvent hotswapping to a common location (#3199)
Fixes a variety of issues where clients were receiving pseudoIDs in places that should be userIDs. This change makes pseudoIDs work with sliding sync & element x. --------- Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
This commit is contained in:
parent
8245b24100
commit
db83789654
13 changed files with 426 additions and 333 deletions
|
@ -75,20 +75,15 @@ func (p *InviteStreamProvider) IncrementalSync(
|
|||
user = *sender
|
||||
}
|
||||
|
||||
sk := inviteEvent.StateKey()
|
||||
if sk != nil && *sk != "" {
|
||||
skUserID, err := p.rsAPI.QueryUserIDForSender(ctx, inviteEvent.RoomID(), spec.SenderID(*inviteEvent.StateKey()))
|
||||
if err == nil && skUserID != nil {
|
||||
skString := skUserID.String()
|
||||
sk = &skString
|
||||
}
|
||||
}
|
||||
|
||||
// skip ignored user events
|
||||
if _, ok := req.IgnoredUsers.List[user.String()]; ok {
|
||||
continue
|
||||
}
|
||||
ir := types.NewInviteResponse(inviteEvent, user, sk, eventFormat)
|
||||
ir, err := types.NewInviteResponse(ctx, p.rsAPI, inviteEvent, eventFormat)
|
||||
if err != nil {
|
||||
req.Log.WithError(err).Error("failed creating invite response")
|
||||
continue
|
||||
}
|
||||
req.Response.Rooms.Invite[roomID] = ir
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue