MM-11868/MM-12010/MM-12011/MM-12036 Improve post metadata structure (#9693)
* MM-11868/MM-12010/MM-12011/MM-12036 Include dimensions for opengraph and message attachment images in post metadata * Remove duplicate check from getFirstLinkAndImages * Add tests for getImagesInMessageAttachments * Rename PostMetadata.FileInfos to PostMetadata.Files * Rename Metadata.ImageDimensions to Metadata.Images
Этот коммит содержится в:
28
model/post_metadata.go
Обычный файл
28
model/post_metadata.go
Обычный файл
@@ -0,0 +1,28 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
package model
|
||||
|
||||
type PostMetadata struct {
|
||||
// An array of the information required to render additional details about the contents of this post.
|
||||
Embeds []*PostEmbed `json:"embeds,omitempty"`
|
||||
|
||||
// An arrayof the custom emojis used in the post or in reactions to the post.
|
||||
Emojis []*Emoji `json:"emojis,omitempty"`
|
||||
|
||||
// An array of information about the file attachments on the post.
|
||||
Files []*FileInfo `json:"files,omitempty"`
|
||||
|
||||
// A map of image URL to information about all external images in the post. This includes image embeds,
|
||||
// inline Markdown images, OpenGraph images, and message attachment images, but it does not contain the dimensions
|
||||
// of file attachments which are contained in PostMetadata.FileInfos.
|
||||
Images map[string]*PostImage `json:"images,omitempty"`
|
||||
|
||||
// A map of emoji names to a count of users that reacted with the given emoji.
|
||||
ReactionCounts ReactionCounts `json:"reaction_counts,omitempty"`
|
||||
}
|
||||
|
||||
type PostImage struct {
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
}
|
||||
Ссылка в новой задаче
Block a user