aboutsummaryrefslogtreecommitdiff
path: root/syncapi/routing/getevent.go
diff options
context:
space:
mode:
authordevonh <devon.dmytro@gmail.com>2023-06-12 11:19:25 +0000
committerGitHub <noreply@github.com>2023-06-12 11:19:25 +0000
commit77d9e4e93dd01f6baa82bd6236850c1007346cac (patch)
tree20be66224646cc82199028cf89f4cd7fab80b97f /syncapi/routing/getevent.go
parent832ccc32f6a023665e250eee44b5f678e985d50e (diff)
Cleanup remaining statekey usage for senderIDs (#3106)
Diffstat (limited to 'syncapi/routing/getevent.go')
-rw-r--r--syncapi/routing/getevent.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/syncapi/routing/getevent.go b/syncapi/routing/getevent.go
index 63df7e83..de790e5c 100644
--- a/syncapi/routing/getevent.go
+++ b/syncapi/routing/getevent.go
@@ -106,8 +106,17 @@ func GetEvent(
if err == nil && senderUserID != nil {
sender = *senderUserID
}
+
+ sk := events[0].StateKey()
+ if sk != nil && *sk != "" {
+ skUserID, err := rsAPI.QueryUserIDForSender(ctx, events[0].RoomID(), spec.SenderID(*events[0].StateKey()))
+ if err == nil && skUserID != nil {
+ skString := skUserID.String()
+ sk = &skString
+ }
+ }
return util.JSONResponse{
Code: http.StatusOK,
- JSON: synctypes.ToClientEvent(events[0], synctypes.FormatAll, sender),
+ JSON: synctypes.ToClientEvent(events[0], synctypes.FormatAll, sender, sk),
}
}