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
Этот коммит содержится в:
Harrison Healey
2019-04-10 15:48:15 -04:00
коммит произвёл GitHub
родитель 41d117c37b
Коммит a5501cf3f8
2 изменённых файлов: 121 добавлений и 2 удалений

Просмотреть файл

@@ -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,