Skip to content

Commit fc436f4

Browse files
committed
Specify omitempty for some fields in DeviceListUpdateEvent
This should address the cause of matrix-org/synapse#12829. These fields are optional, so we should omit them if they are empty instead of sending `null`.
1 parent eee8fd5 commit fc436f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

device_update.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import "encoding/json"
66
type DeviceListUpdateEvent struct {
77
UserID string `json:"user_id"`
88
DeviceID string `json:"device_id"`
9-
DeviceDisplayName string `json:"device_display_name"`
9+
DeviceDisplayName string `json:"device_display_name,omitempty"`
1010
StreamID int64 `json:"stream_id"`
11-
PrevID []int64 `json:"prev_id"`
12-
Deleted bool `json:"deleted"`
13-
Keys json.RawMessage `json:"keys"`
11+
PrevID []int64 `json:"prev_id,omitempty"`
12+
Deleted bool `json:"deleted,omitempty"`
13+
Keys json.RawMessage `json:"keys,omitempty"`
1414
}

0 commit comments

Comments
 (0)