diff options
author | devonh <devon.dmytro@gmail.com> | 2023-07-06 23:54:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-06 23:54:35 +0000 |
commit | cc9b695c1ed22e47b723032793d4cf087c0f3ecc (patch) | |
tree | afe12d52022d49937f4c2522311bbe1736575ff9 /syncapi | |
parent | 3a125fd8fab320b09457e575d2ae286db84bc108 (diff) |
Populate syncapi state event prev_sender with userID (#3142)
Diffstat (limited to 'syncapi')
-rw-r--r-- | syncapi/consumers/roomserver.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/syncapi/consumers/roomserver.go b/syncapi/consumers/roomserver.go index 7ba3afc4..8c83e688 100644 --- a/syncapi/consumers/roomserver.go +++ b/syncapi/consumers/roomserver.go @@ -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) |