mirror of https://github.com/matrix-org/gomatrix
Omit empty fields on ImageInfo and VideoInfo structs
This commit is contained in:
parent
462346e69d
commit
087ee52a0f
20
events.go
20
events.go
|
@ -46,21 +46,21 @@ type TextMessage struct {
|
||||||
|
|
||||||
// ImageInfo contains info about an image - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-image
|
// ImageInfo contains info about an image - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-image
|
||||||
type ImageInfo struct {
|
type ImageInfo struct {
|
||||||
Height uint `json:"h"`
|
Height uint `json:"h,omitempty"`
|
||||||
Width uint `json:"w"`
|
Width uint `json:"w,omitempty"`
|
||||||
Mimetype string `json:"mimetype"`
|
Mimetype string `json:"mimetype,omitempty"`
|
||||||
Size uint `json:"size"`
|
Size uint `json:"size,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// VideoInfo contains info about a video - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-video
|
// VideoInfo contains info about a video - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-video
|
||||||
type VideoInfo struct {
|
type VideoInfo struct {
|
||||||
Mimetype string `json:"mimetype"`
|
Mimetype string `json:"mimetype,omitempty"`
|
||||||
ThumbnailInfo ImageInfo `json:"thumbnail_info"`
|
ThumbnailInfo ImageInfo `json:"thumbnail_info"`
|
||||||
ThumbnailURL string `json:"thumbnail_url"`
|
ThumbnailURL string `json:"thumbnail_url,omitempty"`
|
||||||
Height uint `json:"h"`
|
Height uint `json:"h,omitempty"`
|
||||||
Width uint `json:"w"`
|
Width uint `json:"w,omitempty"`
|
||||||
Duration uint `json:"duration"`
|
Duration uint `json:"duration,omitempty"`
|
||||||
Size uint `json:"size"`
|
Size uint `json:"size,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// VideoMessage is an m.video - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-video
|
// VideoMessage is an m.video - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-video
|
||||||
|
|
Loading…
Reference in New Issue