mirror of
https://github.com/1f349/dendrite.git
synced 2024-12-25 01:26:29 +00: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 New Issue
Block a user