FIX: email replies to closed topic should not be accepted

This commit is contained in:
Arpit Jalan
2014-10-25 20:06:59 +05:30
parent 1e13cfe8ce
commit 08dc0e6ee6
5 changed files with 67 additions and 1 deletions

View File

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