mirror of
				https://github.com/matrix-org/gomatrix
				synced 2025-11-03 22:08:04 +00:00 
			
		
		
		
	Merge pull request #65 from matrix-org/babolivier/thumbnails
ImageInfo can have a Thumbnail (and it's needed for Riot on Android)
This commit is contained in:
		
						commit
						0c31efc5dc
					
				
					 1 changed files with 19 additions and 9 deletions
				
			
		
							
								
								
									
										16
									
								
								events.go
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								events.go
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -46,18 +46,28 @@ 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"`
 | 
			
		||||
	ThumbnailInfo ThumbnailInfo `json:"thumbnail_info"`
 | 
			
		||||
	ThumbnailURL  string        `json:"thumbnail_url,omitempty"`
 | 
			
		||||
	Height        uint          `json:"h,omitempty"`
 | 
			
		||||
	Width         uint          `json:"w,omitempty"`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue