MM-15302 Don't get post embeds with link previews disabled (#10587)
* MM-15302 Don't get post embeds with link previews disabled * Enable link previews for other metadata tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
41d117c37b
Коммит
a5501cf3f8
@@ -127,7 +127,7 @@ func (a *App) getEmbedForPost(post *model.Post, firstLink string, isNewPost bool
|
||||
}, nil
|
||||
}
|
||||
|
||||
if firstLink == "" {
|
||||
if firstLink == "" || !*a.Config().ServiceSettings.EnableLinkPreviews {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ func (a *App) getEmbedForPost(post *model.Post, firstLink string, isNewPost bool
|
||||
}
|
||||
|
||||
if image != nil {
|
||||
// Note that we're not passing the image info here since they'll be part of the PostMetadata.Images field
|
||||
// Note that we're not passing the image info here since it'll be part of the PostMetadata.Images field
|
||||
return &model.PostEmbed{
|
||||
Type: model.POST_EMBED_IMAGE,
|
||||
URL: firstLink,
|
||||
|
||||
Ссылка в новой задаче
Block a user