Skip to content

Commit

Permalink
ping on fp feedback on autoflagged post
Browse files Browse the repository at this point in the history
  • Loading branch information
quartata committed Feb 13, 2018
1 parent 46d925d commit 55d9d40
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/models/feedback.rb
Expand Up @@ -23,7 +23,16 @@ class Feedback < ApplicationRecord
after_save do
if update_post_feedback_cache # if post feedback cache was changed
if post.flagged? && post.is_fp
SmokeDetector.send_message_to_charcoal "fp feedback on autoflagged post: [#{post.title}](//metasmoke.erwaysoftware.com/post/#{post_id})"
names = []

post.flag_logs.each do |flag|
if flag.success && flag.user.username then
names << flag.user.username.tr(' ', '')
end
end

SmokeDetector.send_message_to_charcoal "fp feedback on autoflagged post: [#{post.title}](//metasmoke.erwaysoftware.com/post/#{post_id})" \
" (#{names.join " "})"
end
end
end
Expand Down

0 comments on commit 55d9d40

Please sign in to comment.