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
Этот коммит содержится в:
@@ -11,7 +11,6 @@ import (
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/dyatlov/go-opengraph/opengraph"
|
||||
"github.com/mattermost/mattermost-server/utils/markdown"
|
||||
)
|
||||
|
||||
@@ -83,18 +82,8 @@ type Post struct {
|
||||
PendingPostId string `json:"pending_post_id" db:"-"`
|
||||
HasReactions bool `json:"has_reactions,omitempty"` // Deprecated, do not use this field any more
|
||||
|
||||
// Transient fields populated before sending posts to the client
|
||||
ReactionCounts ReactionCounts `json:"reaction_counts" db:"-"`
|
||||
FileInfos []*FileInfo `json:"file_infos" db:"-"`
|
||||
ImageDimensions []*PostImageDimensions `json:"image_dimensions" db:"-"`
|
||||
OpenGraphData []*opengraph.OpenGraph `json:"opengraph_data" db:"-"`
|
||||
Emojis []*Emoji `json:"emojis" db:"-"`
|
||||
}
|
||||
|
||||
type PostImageDimensions struct {
|
||||
URL string `json:"url"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
// Transient data populated before sending a post to the client
|
||||
Metadata *PostMetadata `json:"metadata" db:"-"`
|
||||
}
|
||||
|
||||
type PostEphemeral struct {
|
||||
|
||||
Ссылка в новой задаче
Block a user