SECURITY: do not send push notifications to suspended users

This commit is contained in:
Sam Saffron
2017-04-05 08:28:24 -04:00
parent 9065df76ad
commit cd39049262
2 changed files with 21 additions and 1 deletions

View File

@@ -373,7 +373,7 @@ class PostAlerter
post_action_id: opts[:post_action_id],
data: notification_data.to_json)
if !existing_notification && NOTIFIABLE_TYPES.include?(type)
if !existing_notification && NOTIFIABLE_TYPES.include?(type) && !user.suspended?
# we may have an invalid post somehow, dont blow up
post_url = original_post.url rescue nil
if post_url