From 6e3c54b72c03f5b0d3bd46287b75808868df34b6 Mon Sep 17 00:00:00 2001 From: francis Date: Mon, 19 May 2008 12:01:21 +0000 Subject: Option to stop new respones for individual requests which for whatever reason are getting spam. --- app/models/info_request.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 64ed65a63..1f30c3cbb 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 54 +# Schema version: 55 # # Table name: info_requests # @@ -13,6 +13,7 @@ # awaiting_description :boolean default(false), not null # prominence :string(255) default("normal"), not null # url_title :text not null +# stop_new_responses :boolean default(false), not null # # models/info_request.rb: @@ -21,7 +22,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request.rb,v 1.111 2008-05-16 19:19:42 francis Exp $ +# $Id: info_request.rb,v 1.112 2008-05-19 12:01:22 francis Exp $ require 'digest/sha1' require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian') @@ -164,6 +165,13 @@ public # A new incoming email to this request def receive(email, raw_email) + # See if new responses are prevented for spam reasons + if self.stop_new_responses + RequestMailer.deliver_stopped_responses(self, email) + return + end + + # Otherwise log the message incoming_message = IncomingMessage.new ActiveRecord::Base.transaction do -- cgit v1.2.3