Merge pull request #27 from matrix-org/rxl881/videoMessages

Omit empty fields on ImageInfo and VideoInfo structs
This commit is contained in:
Richard Lewis 2017-05-11 15:02:20 +01:00 committed by GitHub
commit 27ae91d1b3
1 changed files with 10 additions and 10 deletions

View File

@ -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