mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: don't allow blocked user to send emails in
This commit is contained in:
@ -13,6 +13,7 @@ module Email
|
||||
class AutoGeneratedEmailError < ProcessingError; end
|
||||
class NoBodyDetectedError < ProcessingError; end
|
||||
class InactiveUserError < ProcessingError; end
|
||||
class BlockedUserError < ProcessingError; end
|
||||
class BadDestinationAddress < ProcessingError; end
|
||||
class StrangersNotAllowedError < ProcessingError; end
|
||||
class InsufficientTrustLevelError < ProcessingError; end
|
||||
@ -53,8 +54,9 @@ module Email
|
||||
body = select_body || ""
|
||||
|
||||
raise AutoGeneratedEmailError if is_auto_generated?
|
||||
raise NoBodyDetectedError if body.blank? && !@mail.has_attachments?
|
||||
raise InactiveUserError if !user.active && !user.staged
|
||||
raise NoBodyDetectedError if body.blank? && !@mail.has_attachments?
|
||||
raise InactiveUserError if !user.active && !user.staged
|
||||
raise BlockedUserError if user.blocked
|
||||
|
||||
if action = subscription_action_for(body, subject)
|
||||
message = SubscriptionMailer.send(action, user)
|
||||
|
Reference in New Issue
Block a user