mattermost/server/public/model/post_embed.go

34 lines
936 B
Go
Raw Permalink Normal View History

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package model
const (
2021-07-12 14:05:36 -04:00
PostEmbedImage PostEmbedType = "image"
PostEmbedMessageAttachment PostEmbedType = "message_attachment"
PostEmbedOpengraph PostEmbedType = "opengraph"
PostEmbedLink PostEmbedType = "link"
2021-08-09 11:33:21 -04:00
PostEmbedPermalink PostEmbedType = "permalink"
PostEmbedBoards PostEmbedType = "boards"
)
type PostEmbedType string
type PostEmbed struct {
Type PostEmbedType `json:"type"`
// The URL of the embedded content. Used for image and OpenGraph embeds.
URL string `json:"url,omitempty"`
// Any additional data for the embedded content. Only used for OpenGraph embeds.
Data any `json:"data,omitempty"`
}
func (pe *PostEmbed) Auditable() map[string]any {
// filter out embedded content.
return map[string]any{
"type": pe.Type,
"url": pe.URL,
}
}