Add DiscourseEvents for when users as unsuspended/unsilenced

This commit is contained in:
Robin Ward 2018-11-08 16:32:59 -05:00
parent 667af9debd
commit 242a5fc5ef
2 changed files with 3 additions and 0 deletions

View File

@ -156,6 +156,8 @@ class Admin::UsersController < Admin::AdminController
@user.save!
StaffActionLogger.new(current_user).log_user_unsuspend(@user)
DiscourseEvent.trigger(:user_unsuspended, user: @user)
render_json_dump(
suspension: {
suspended: false

View File

@ -71,6 +71,7 @@ class UserSilencer
def unsilence
@user.silenced_till = nil
if @user.save
DiscourseEvent.trigger(:user_unsilenced, user: @user)
SystemMessage.create(@user, :unsilenced)
StaffActionLogger.new(@by_user).log_unsilence_user(@user) if @by_user
end