FEATURE: Notify flaggers when flagged post is edited by author

This commit is contained in:
Gerhard Schlager
2018-04-06 23:37:29 +02:00
parent 0e9ec237a2
commit 62aacce8f4
3 changed files with 60 additions and 0 deletions

View File

@@ -405,10 +405,15 @@ class PostRevisor
def remove_flags_and_unhide_post
return unless editing_a_flagged_and_hidden_post?
flaggers = []
@post.post_actions.where(post_action_type_id: PostActionType.flag_types_without_custom.values).each do |action|
flaggers << action.user if action.user
action.remove_act!(Discourse.system_user)
end
@post.unhide!
PostActionNotifier.after_post_unhide(@post, flaggers)
end
def editing_a_flagged_and_hidden_post?