Prevent flagging of deleted posts and don't show deleted posts in flagged post list (#3846)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
c3c62ad2ad
Коммит
80d83ae77c
@@ -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
|
||||
|
||||
Ссылка в новой задаче
Block a user