mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-26 00:01:55 -06:00
Populate syncapi state event prev_sender with userID (#3142)
This commit is contained in:
parent
3a125fd8fa
commit
cc9b695c1e
|
@ -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