diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2023-06-13 12:50:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-13 12:50:22 +0200 |
commit | 82b73a49068771168ed52351f7be3b033692be4a (patch) | |
tree | 7738bc2269384ad727102945918cb523ab123c45 /syncapi | |
parent | 77d9e4e93dd01f6baa82bd6236850c1007346cac (diff) |
Add `sender_key` to ClientEvent (#3110)
Diffstat (limited to 'syncapi')
-rw-r--r-- | syncapi/synctypes/clientevent.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/syncapi/synctypes/clientevent.go b/syncapi/synctypes/clientevent.go index 358a0c97..433be39f 100644 --- a/syncapi/synctypes/clientevent.go +++ b/syncapi/synctypes/clientevent.go @@ -37,6 +37,7 @@ type ClientEvent struct { OriginServerTS spec.Timestamp `json:"origin_server_ts,omitempty"` // OriginServerTS is omitted on receipt events RoomID string `json:"room_id,omitempty"` // RoomID is omitted on /sync responses Sender string `json:"sender,omitempty"` // Sender is omitted on receipt events + SenderKey spec.SenderID `json:"sender_key,omitempty"` // The SenderKey for events in pseudo ID rooms StateKey *string `json:"state_key,omitempty"` Type string `json:"type"` Unsigned spec.RawJSON `json:"unsigned,omitempty"` @@ -84,6 +85,9 @@ func ToClientEvent(se gomatrixserverlib.PDU, format ClientEventFormat, sender sp if format == FormatAll { ce.RoomID = se.RoomID() } + if se.Version() == gomatrixserverlib.RoomVersionPseudoIDs { + ce.SenderKey = se.SenderID() + } return ce } |