aboutsummaryrefslogtreecommitdiff
path: root/syncapi/routing/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'syncapi/routing/context.go')
-rw-r--r--syncapi/routing/context.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/syncapi/routing/context.go b/syncapi/routing/context.go
index 13c4e9d8..1ebdfe60 100644
--- a/syncapi/routing/context.go
+++ b/syncapi/routing/context.go
@@ -37,11 +37,11 @@ import (
type ContextRespsonse struct {
End string `json:"end"`
- Event gomatrixserverlib.ClientEvent `json:"event"`
+ Event *gomatrixserverlib.ClientEvent `json:"event,omitempty"`
EventsAfter []gomatrixserverlib.ClientEvent `json:"events_after,omitempty"`
EventsBefore []gomatrixserverlib.ClientEvent `json:"events_before,omitempty"`
Start string `json:"start"`
- State []gomatrixserverlib.ClientEvent `json:"state"`
+ State []gomatrixserverlib.ClientEvent `json:"state,omitempty"`
}
func Context(
@@ -162,8 +162,9 @@ func Context(
eventsAfterClient := gomatrixserverlib.HeaderedToClientEvents(eventsAfterFiltered, gomatrixserverlib.FormatAll)
newState := applyLazyLoadMembers(device, filter, eventsAfterClient, eventsBeforeClient, state, lazyLoadCache)
+ ev := gomatrixserverlib.HeaderedToClientEvent(&requestedEvent, gomatrixserverlib.FormatAll)
response := ContextRespsonse{
- Event: gomatrixserverlib.HeaderedToClientEvent(&requestedEvent, gomatrixserverlib.FormatAll),
+ Event: &ev,
EventsAfter: eventsAfterClient,
EventsBefore: eventsBeforeClient,
State: gomatrixserverlib.HeaderedToClientEvents(newState, gomatrixserverlib.FormatAll),