Add discourse events for when a user is suspended/silenced
This commit is contained in:
parent
a0f0ed576a
commit
dd33050e10
|
@ -82,6 +82,17 @@ class Admin::UsersController < Admin::AdminController
|
|||
)
|
||||
end
|
||||
|
||||
DiscourseEvent.trigger(
|
||||
:user_suspended,
|
||||
user: @user,
|
||||
reason: params[:reason],
|
||||
message: message,
|
||||
user_history: user_history,
|
||||
post_id: params[:post_id],
|
||||
suspended_till: params[:suspend_until],
|
||||
suspended_at: DateTime.now
|
||||
)
|
||||
|
||||
render_json_dump(
|
||||
suspension: {
|
||||
suspended: true,
|
||||
|
|
|
@ -34,6 +34,17 @@ class UserSilencer
|
|||
details: details
|
||||
)
|
||||
end
|
||||
|
||||
DiscourseEvent.trigger(
|
||||
:user_silenced,
|
||||
user: @user,
|
||||
reason: @opts[:reason],
|
||||
message: @opts[:message_body],
|
||||
user_history: @user_history,
|
||||
post_id: @opts[:post_id],
|
||||
silenced_till: @user.silenced_till,
|
||||
silenced_at: DateTime.now
|
||||
)
|
||||
return true
|
||||
end
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue