aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/incoming_message.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/incoming_message.rb')
-rw-r--r--app/models/incoming_message.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 32123ae49..52f28a3fd 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -792,15 +792,17 @@ class IncomingMessage < ActiveRecord::Base
return self.cached_attachment_text_clipped
end
- def _get_attachment_text_internal
+ def _extract_text
# Extract text from each attachment
- text = ''
- attachments = self.get_attachments_for_display
- for attachment in attachments
- text += MailHandler.get_attachment_text_one_file(attachment.content_type,
+ self.get_attachments_for_display.reduce(''){ |memo, attachment|
+ memo += MailHandler.get_attachment_text_one_file(attachment.content_type,
attachment.body,
attachment.charset)
- end
+ }
+ end
+
+ def _get_attachment_text_internal
+ text = self._extract_text
# Remove any bad characters
if String.method_defined?(:encode)
@@ -812,7 +814,6 @@ class IncomingMessage < ActiveRecord::Base
end
end
-
# Returns text for indexing
def get_text_for_indexing_full
return get_body_for_quoting + "\n\n" + get_attachment_text_full