Omit empty to_device

This commit is contained in:
Till Faelligen 2022-08-09 07:54:51 +02:00
parent 73bde1d995
commit 86bbee227e
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -21,9 +21,10 @@ import (
"strconv"
"strings"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/gomatrixserverlib"
"github.com/tidwall/gjson"
"github.com/matrix-org/dendrite/roomserver/api"
)
var (
@ -341,8 +342,8 @@ type Response struct {
Leave map[string]LeaveResponse `json:"leave"`
} `json:"rooms"`
ToDevice struct {
Events []gomatrixserverlib.SendToDeviceEvent `json:"events"`
} `json:"to_device"`
Events []gomatrixserverlib.SendToDeviceEvent `json:"events,omitempty"`
} `json:"to_device,omitempty"`
DeviceLists struct {
Changed []string `json:"changed,omitempty"`
Left []string `json:"left,omitempty"`