mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00: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
|
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{
|
prev := types.PrevEventRef{
|
||||||
PrevContent: prevEvent.Content(),
|
PrevContent: prevEvent.Content(),
|
||||||
ReplacesState: prevEvent.EventID(),
|
ReplacesState: prevEvent.EventID(),
|
||||||
PrevSenderID: string(prevEvent.SenderID()),
|
PrevSenderID: prevEventSender,
|
||||||
}
|
}
|
||||||
|
|
||||||
event.PDU, err = event.SetUnsigned(prev)
|
event.PDU, err = event.SetUnsigned(prev)
|
||||||
|
|
Loading…
Reference in a new issue