Removed PostPreview from MessageHasBeenPosted payload. (#18613)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4a7cf864be
Коммит
55ea07677d
@@ -292,6 +292,14 @@ func (a *App) CreatePost(c *request.Context, post *model.Post, channel *model.Ch
|
||||
|
||||
// We make a copy of the post for the plugin hook to avoid a race condition.
|
||||
rPostCopy := rpost.Clone()
|
||||
|
||||
// FIXME: Removes PreviewPost from the post payload sent to the MessageHasBeenPosted hook so that plugins compiled with older versions of
|
||||
// Mattermost—without the gob registeration of the PreviewPost struct—won't crash.
|
||||
if rPostCopy.Metadata != nil {
|
||||
rPostCopy.Metadata = rPostCopy.Metadata.Copy()
|
||||
}
|
||||
rPostCopy.RemovePreviewPost()
|
||||
|
||||
if pluginsEnvironment := a.GetPluginsEnvironment(); pluginsEnvironment != nil {
|
||||
a.Srv().Go(func() {
|
||||
pluginContext := pluginContext(c)
|
||||
|
||||
Ссылка в новой задаче
Block a user