From c61dbb0798bab079af9846a37d8de6136cc4505d Mon Sep 17 00:00:00 2001 From: jomo Date: Thu, 25 Sep 2014 23:30:10 +0200 Subject: [PATCH] fix t/235: mentioned users see thread parts in email --- app/models/forumthread.rb | 2 +- app/models/threadreply.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/forumthread.rb b/app/models/forumthread.rb index e2de6a7..0d7a5d4 100644 --- a/app/models/forumthread.rb +++ b/app/models/forumthread.rb @@ -47,7 +47,7 @@ class Forumthread < ActiveRecord::Base mails = [] new_mentions.each do |user| begin - mails << RedstonerMailer.new_thread_mention_mail(user, self) if user.normal? && user.confirmed? && user.mail_mention? + mails << RedstonerMailer.new_thread_mention_mail(user, self) if user.normal? && user.confirmed? && self.can_read?(user) && user.mail_mention? rescue => e Rails.logger.error "---" Rails.logger.error "WARNING: Failed to create new_thread_mention_mail (view) for reply#: #{@self.id}, user: #{@user.name}, #{@user.email}" diff --git a/app/models/threadreply.rb b/app/models/threadreply.rb index a5bd425..b925b0e 100644 --- a/app/models/threadreply.rb +++ b/app/models/threadreply.rb @@ -38,7 +38,7 @@ class Threadreply < ActiveRecord::Base mails = [] new_mentions.each do |user| begin - mails << RedstonerMailer.new_thread_reply_mention_mail(user, self) if user.normal? && user.confirmed? && user.mail_mention? + mails << RedstonerMailer.new_thread_reply_mention_mail(user, self) if user.normal? && user.confirmed? && self.thread.can_read?(user) && user.mail_mention? rescue => e Rails.logger.error "---" Rails.logger.error "WARNING: Failed to create new_thread_reply_mention_mail (view) for reply#: #{@self.id}, user: #{@user.name}, #{@user.email}"