diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/post.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/api/post.go b/api/post.go index fa42e6f88..b4c70fab2 100644 --- a/api/post.go +++ b/api/post.go @@ -1332,6 +1332,7 @@ func deletePost(c *Context, w http.ResponseWriter, r *http.Request) { go Publish(message) go DeletePostFiles(c.TeamId, post) + go DeleteFlaggedPost(c.Session.UserId, post) result := make(map[string]string) result["id"] = postId @@ -1339,6 +1340,13 @@ func deletePost(c *Context, w http.ResponseWriter, r *http.Request) { } } +func DeleteFlaggedPost(userId string, post *model.Post) { + if result := <-Srv.Store.Preference().Delete(userId, model.PREFERENCE_CATEGORY_FLAGGED_POST, post.Id); result.Err != nil { + l4g.Warn(utils.T("api.post.delete_flagged_post.app_error.warn"), result.Err) + return + } +} + func DeletePostFiles(teamId string, post *model.Post) { if len(post.Filenames) == 0 { return |