Add system console switch for enabling link previews (#5663)

Этот коммит содержится в:
Joram Wilander
2017-03-06 21:13:12 -05:00
коммит произвёл Christopher Speller
родитель f99658152a
Коммит e87f5c6cf9
12 изменённых файлов: 128 добавлений и 6 удалений

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

@@ -452,6 +452,11 @@ func getFileInfosForPost(c *Context, w http.ResponseWriter, r *http.Request) {
}
func getOpenGraphMetadata(c *Context, w http.ResponseWriter, r *http.Request) {
if !*utils.Cfg.ServiceSettings.EnableLinkPreviews {
c.Err = model.NewAppError("getOpenGraphMetadata", "api.post.link_preview_disabled.app_error", nil, "", http.StatusNotImplemented)
return
}
props := model.StringInterfaceFromJson(r.Body)
ogJSONGeneric, ok := openGraphDataCache.Get(props["url"])