Merge pull request #2921 from techAPJ/patch-1

FIX: email replies should not be accepted for deleted topics
This commit is contained in:
Sam
2014-10-28 14:11:33 +11:00
5 changed files with 67 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ module Email
class UserNotFoundError < ProcessingError; end
class UserNotSufficientTrustLevelError < ProcessingError; end
class BadDestinationAddress < ProcessingError; end
class TopicNotFoundError < ProcessingError; end
class TopicClosedError < ProcessingError; end
class EmailLogNotFound < ProcessingError; end
class InvalidPost < ProcessingError; end
@@ -69,6 +70,7 @@ module Email
@email_log = dest_info[:obj]
raise EmailLogNotFound if @email_log.blank?
raise TopicNotFoundError if Topic.find_by_id(@email_log.topic_id).nil?
raise TopicClosedError if Topic.find_by_id(@email_log.topic_id).closed?
create_reply