mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* MM-22845: Added support for permalink previews. * MM-22845: Adds license to new file. * MM-22845: Adds endpoint to retrieve multiple posts by id. * MM-22845: Fix for deleted post. * MM-22845: Adds config setting for permalink previews. * MM-22845: Adds API test for new endpoint. * MM-22845: Fix typo. * MM-22845: Tests that post create or updated via App get the previewed_post prop. * MM-22845: Tests for matching permalinks. * MM-22845: Adds PreparePostForClient test for permalink previews. * MM-22845: Embeds entire post in permalink metadata. * MM-22845: Filter WS message payload of created and edited post based on permissions. * MM-22845: Runs app layer generator. * MM-22845: Lint check fix. * MM-22845: Adds feature flag. * MM-22845: Clones WS message. * MM-22845: Removes knowledge of permalink from LinkMetadata table. Removes knowledge of user id from post embedding methods in favour of a 'sanitize' method/step. * MM-22845: Handle nil post metadata. * MM-22845: Switch to cloning post. * MM-22845: Removes unused code. * MM-22845: Refactor. * MM-22845: Reverts whitespace change. * MM-22845: Removes unnecessary code. * MM-22845: Removes unnecessary function. * MM-22845: Warn but don't error if permalinked referenced post or channel is not found. * MM-22845: Fix for clone method. * MM-22845: Fix for clone method. * MM-22845: Updates translations. Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
51 lines
1.1 KiB
Go
51 lines
1.1 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package model
|
|
|
|
import "encoding/json"
|
|
|
|
type MessageExport struct {
|
|
TeamId *string
|
|
TeamName *string
|
|
TeamDisplayName *string
|
|
|
|
ChannelId *string
|
|
ChannelName *string
|
|
ChannelDisplayName *string
|
|
ChannelType *ChannelType
|
|
|
|
UserId *string
|
|
UserEmail *string
|
|
Username *string
|
|
IsBot bool
|
|
|
|
PostId *string
|
|
PostCreateAt *int64
|
|
PostUpdateAt *int64
|
|
PostDeleteAt *int64
|
|
PostMessage *string
|
|
PostType *string
|
|
PostRootId *string
|
|
PostProps *string
|
|
PostOriginalId *string
|
|
PostFileIds StringArray
|
|
}
|
|
|
|
type MessageExportCursor struct {
|
|
LastPostUpdateAt int64
|
|
LastPostId string
|
|
}
|
|
|
|
// PreviewID returns the value of the post's previewed_post prop, if present, or an empty string.
|
|
func (m *MessageExport) PreviewID() string {
|
|
var previewID string
|
|
props := map[string]interface{}{}
|
|
if m.PostProps != nil && json.Unmarshal([]byte(*m.PostProps), &props) == nil {
|
|
if val, ok := props[PostPropsPreviewedPost]; ok {
|
|
previewID = val.(string)
|
|
}
|
|
}
|
|
return previewID
|
|
}
|