mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 03:10:46 -06:00
DEV: Expose silencer customization options to plugins (#11456)
Passes by_user to :user_unsilenced so plugins can detect whether or not a silence was done automatically (by system user) or manually (by non-system) Adds the ability to pass details in the action logger params so custom loggers can pass their own details eg, in custom silence logs
This commit is contained in:
parent
adda53c462
commit
4858ae0b19
@ -821,7 +821,7 @@ class StaffActionLogger
|
||||
|
||||
def params(opts = nil)
|
||||
opts ||= {}
|
||||
{ acting_user_id: @admin.id, context: opts[:context] }
|
||||
{ acting_user_id: @admin.id, context: opts[:context], details: opts[:details] }
|
||||
end
|
||||
|
||||
def validate_category(category)
|
||||
|
@ -80,7 +80,7 @@ class UserSilencer
|
||||
def unsilence
|
||||
@user.silenced_till = nil
|
||||
if @user.save
|
||||
DiscourseEvent.trigger(:user_unsilenced, user: @user)
|
||||
DiscourseEvent.trigger(:user_unsilenced, user: @user, by_user: @by_user)
|
||||
SystemMessage.create(@user, :unsilenced)
|
||||
StaffActionLogger.new(@by_user).log_unsilence_user(@user) if @by_user
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user