diff options
Diffstat (limited to 'app/post.go')
-rw-r--r-- | app/post.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/post.go b/app/post.go index fa929b844..da5661ae2 100644 --- a/app/post.go +++ b/app/post.go @@ -362,9 +362,6 @@ func (a *App) PatchPost(postId string, patch *model.PostPatch) (*model.Post, *mo return nil, err } - a.sendUpdatedPostEvent(updatedPost) - a.InvalidateCacheForChannelPosts(updatedPost.ChannelId) - return updatedPost, nil } @@ -620,6 +617,10 @@ func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOr return postList, nil } else { + if !*utils.Cfg.ServiceSettings.EnablePostSearch { + return nil, model.NewAppError("SearchPostsInTeam", "store.sql_post.search.disabled", nil, fmt.Sprintf("teamId=%v userId=%v", teamId, userId), http.StatusNotImplemented) + } + channels := []store.StoreChannel{} for _, params := range paramsList { @@ -682,7 +683,7 @@ func GetOpenGraphMetadata(url string) *opengraph.OpenGraph { l4g.Error("GetOpenGraphMetadata request failed for url=%v with err=%v", url, err.Error()) return og } - defer CloseBody(res) + defer consumeAndClose(res) if err := og.ProcessHTML(res.Body); err != nil { l4g.Error("GetOpenGraphMetadata processing failed for url=%v with err=%v", url, err.Error()) @@ -718,7 +719,7 @@ func (a *App) DoPostAction(postId string, actionId string, userId string) *model if err != nil { return model.NewAppError("DoPostAction", "api.post.do_action.action_integration.app_error", nil, "err="+err.Error(), http.StatusBadRequest) } - defer resp.Body.Close() + defer consumeAndClose(resp) if resp.StatusCode != http.StatusOK { return model.NewAppError("DoPostAction", "api.post.do_action.action_integration.app_error", nil, fmt.Sprintf("status=%v", resp.StatusCode), http.StatusBadRequest) |