aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/incoming_message.rb4
-rw-r--r--app/models/info_request_event.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index f444e92ad..37acc6a99 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -76,6 +76,10 @@ class IncomingMessage < ActiveRecord::Base
Ability.can_view_with_prominence?(self.prominence, self.info_request, user)
end
+ def indexed_by_search?
+ self.prominence == 'normal'
+ end
+
# Return a cached structured mail object
def mail(force = nil)
if (!force.nil? || @mail.nil?) && !self.raw_email.nil?
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index 6c8d21f99..78c800ad1 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -235,6 +235,9 @@ class InfoRequestEvent < ActiveRecord::Base
if !self.info_request.indexed_by_search?
return false
end
+ if self.event_type == 'response' && !self.incoming_message.indexed_by_search?
+ return false
+ end
if self.event_type == 'comment' && !self.comment.visible
return false
end
@@ -243,6 +246,7 @@ class InfoRequestEvent < ActiveRecord::Base
return false
end
end
+
def variety
self.event_type
end