From 5df0d882cdb5c41f1a0f863595f4dc5bd3e6a960 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Sun, 7 Apr 2019 03:59:56 +0200 Subject: [PATCH] ImageInfo can have a Thumbnail (and it's needed for Riot on Android) --- events.go | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/events.go b/events.go index 1a82803..edf231a 100644 --- a/events.go +++ b/events.go @@ -46,23 +46,33 @@ type TextMessage struct { Body string `json:"body"` } -// ImageInfo contains info about an image - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-image -type ImageInfo struct { +// ThumbnailInfo contains info about an thumbnail image - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-image +type ThumbnailInfo struct { Height uint `json:"h,omitempty"` Width uint `json:"w,omitempty"` Mimetype string `json:"mimetype,omitempty"` Size uint `json:"size,omitempty"` } +// ImageInfo contains info about an image - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-image +type ImageInfo struct { + Height uint `json:"h,omitempty"` + Width uint `json:"w,omitempty"` + Mimetype string `json:"mimetype,omitempty"` + Size uint `json:"size,omitempty"` + ThumbnailInfo ThumbnailInfo `json:"thumbnail_info,omitempty"` + ThumbnailURL string `json:"thumbnail_url,omitempty"` +} + // VideoInfo contains info about a video - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-video type VideoInfo struct { - Mimetype string `json:"mimetype,omitempty"` - ThumbnailInfo ImageInfo `json:"thumbnail_info"` - ThumbnailURL string `json:"thumbnail_url,omitempty"` - Height uint `json:"h,omitempty"` - Width uint `json:"w,omitempty"` - Duration uint `json:"duration,omitempty"` - Size uint `json:"size,omitempty"` + Mimetype string `json:"mimetype,omitempty"` + ThumbnailInfo ThumbnailInfo `json:"thumbnail_info"` + ThumbnailURL string `json:"thumbnail_url,omitempty"` + Height uint `json:"h,omitempty"` + Width uint `json:"w,omitempty"` + Duration uint `json:"duration,omitempty"` + Size uint `json:"size,omitempty"` } // VideoMessage is an m.video - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-video