FIX: email replies should not be accepted for deleted topics

This commit is contained in:
Arpit Jalan
2014-10-27 12:28:31 +05:30
parent 9445000b58
commit b37d845dd3
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