mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 07:37:55 +08:00
Don't allow sending private messages to suspended users. Emails to suspended users should tell them how to respond, since they can't.
This commit is contained in:
@ -215,7 +215,9 @@ class Guardian
|
||||
# PMs are enabled
|
||||
(SiteSetting.enable_private_messages ||
|
||||
@user.username == SiteSetting.site_contact_username ||
|
||||
@user == Discourse.system_user)
|
||||
@user == Discourse.system_user) &&
|
||||
# Can't send PMs to suspended users
|
||||
(is_staff? || target.is_a?(Group) || !target.suspended?)
|
||||
end
|
||||
|
||||
private
|
||||
|
Reference in New Issue
Block a user