mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Don't send notification email when user isn't allowed to see topic
This commit is contained in:
@@ -41,6 +41,10 @@ module Jobs
|
||||
unless post.present?
|
||||
return skip(SkippedEmailLog.reason_types[:user_email_post_not_found])
|
||||
end
|
||||
|
||||
if !Guardian.new(user).can_see?(post)
|
||||
return skip(SkippedEmailLog.reason_types[:user_email_access_denied])
|
||||
end
|
||||
end
|
||||
|
||||
if args[:notification_id].present?
|
||||
|
@@ -35,7 +35,8 @@ class SkippedEmailLog < ActiveRecord::Base
|
||||
sender_text_part_body_blank: 18,
|
||||
sender_body_blank: 19,
|
||||
sender_post_deleted: 20,
|
||||
sender_message_to_invalid: 21
|
||||
sender_message_to_invalid: 21,
|
||||
user_email_access_denied: 22
|
||||
# you need to add the reason in server.en.yml below the "skipped_email_log" key
|
||||
# when you add a new enum value
|
||||
)
|
||||
|
Reference in New Issue
Block a user