More extensibility for custom silence/suspend messages

This commit is contained in:
Robin Ward
2018-01-19 11:34:54 -05:00
parent 3cec2394b2
commit a8b46df4bd
4 changed files with 38 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
require_dependency 'staff_message_format'
# Responsible for logging the actions of admins and moderators.
class StaffActionLogger
@@ -170,8 +172,7 @@ class StaffActionLogger
def log_user_suspend(user, reason, opts = {})
raise Discourse::InvalidParameters.new(:user) unless user
details = (reason || '').dup
details << "\n\n#{opts[:message]}" if opts[:message].present?
details = StaffMessageFormat.new(:suspend, reason, opts[:message]).format
args = params(opts).merge(
action: UserHistory.actions[:suspend_user],