mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-25 08:23:53 +01:00
Populate syncapi state event prev_sender with userID (#3142)
This commit is contained in:
parent
3a125fd8fa
commit
cc9b695c1e
1 changed files with 7 additions and 1 deletions
|
@ -591,10 +591,16 @@ func (s *OutputRoomEventConsumer) updateStateEvent(event *rstypes.HeaderedEvent)
|
|||
return event, nil
|
||||
}
|
||||
|
||||
prevEventSender := string(prevEvent.SenderID())
|
||||
prevUser, err := s.rsAPI.QueryUserIDForSender(s.ctx, *validRoomID, prevEvent.SenderID())
|
||||
if err == nil && prevUser != nil {
|
||||
prevEventSender = prevUser.String()
|
||||
}
|
||||
|
||||
prev := types.PrevEventRef{
|
||||
PrevContent: prevEvent.Content(),
|
||||
ReplacesState: prevEvent.EventID(),
|
||||
PrevSenderID: string(prevEvent.SenderID()),
|
||||
PrevSenderID: prevEventSender,
|
||||
}
|
||||
|
||||
event.PDU, err = event.SetUnsigned(prev)
|
||||
|
|
Loading…
Reference in a new issue