Omit state from /messages response if empty

Signed-off-by: Umar Getagazov <umar@handlerug.me>
This commit is contained in:
Umar Getagazov 2023-01-16 12:10:25 +03:00
parent eeeb3017d6
commit dab06f1426

View file

@ -57,7 +57,7 @@ type messagesResp struct {
StartStream string `json:"start_stream,omitempty"` // NOTSPEC: used by Cerulean, so clients can hit /messages then immediately /sync with a latest sync token
End string `json:"end,omitempty"`
Chunk []gomatrixserverlib.ClientEvent `json:"chunk"`
State []gomatrixserverlib.ClientEvent `json:"state"`
State []gomatrixserverlib.ClientEvent `json:"state,omitempty"`
}
// OnIncomingMessagesRequest implements the /messages endpoint from the