Revert "FIX: do not agree flags by default when deleting posts"

This reverts commit cb6fc8057b.
This commit is contained in:
Arpit Jalan
2018-11-28 10:21:11 +05:30
parent 6acabec423
commit 851ef14096
3 changed files with 27 additions and 36 deletions

View File

@@ -147,11 +147,7 @@ class PostDestroyer
update_user_counts
TopicUser.update_post_action_cache(post_id: @post.id)
DB.after_commit do
if @opts[:agree_flags]
agree_with_flags
else
defer_flags
end
agree_with_flags
end
end
@@ -229,7 +225,7 @@ class PostDestroyer
if @post.has_active_flag? && @user.id > 0 && @user.staff?
Jobs.enqueue(
:send_system_message,
user_id: @post.user_id,
user_id: @post.user.id,
message_type: :flags_agreed_and_post_deleted,
message_options: {
url: @post.url,
@@ -241,11 +237,8 @@ class PostDestroyer
}
)
end
PostAction.agree_flags!(@post, @user, delete_post: true)
end
def defer_flags
PostAction.defer_flags!(@post, @user, delete_post: true)
PostAction.agree_flags!(@post, @user, delete_post: true)
end
def trash_user_actions