summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2016-03-25 22:40:35 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2016-03-25 22:40:35 +0100
commitbdf098cb5c32723de559f6bb559866802cdb6367 (patch)
tree85325da6d281ade5e0fa74eff9565fc3a2c9576f /lib
parent9f701d71b52ee045fb59747c74cbb5143d14c371 (diff)
downloadfeed2imap-bdf098cb5c32723de559f6bb559866802cdb6367.tar.gz
feed2imap-bdf098cb5c32723de559f6bb559866802cdb6367.tar.bz2
feed2imap-bdf098cb5c32723de559f6bb559866802cdb6367.zip
images are now rendered inline, no need for the multipart handlingmail
Diffstat (limited to 'lib')
-rw-r--r--lib/feed2imap/itemtomail.rb28
1 files changed, 6 insertions, 22 deletions
diff --git a/lib/feed2imap/itemtomail.rb b/lib/feed2imap/itemtomail.rb
index 63445b0..8cde250 100644
--- a/lib/feed2imap/itemtomail.rb
+++ b/lib/feed2imap/itemtomail.rb
@@ -89,7 +89,6 @@ def item_to_mail(config, item, id, updated, from = 'Feed2Imap', inline_images =
end
# inline images as attachments
- imgs = []
if inline_images
fetcher = HTTPFetcher.new
html = htmlpart.body.decoded
@@ -110,26 +109,11 @@ def item_to_mail(config, item, id, updated, from = 'Feed2Imap', inline_images =
end
htmlpart.body = html
end
-
-
- if imgs.length > 0
- # The old code explicitly used 'multipart/related' here, so force it
- # We then have the structure "related: (alternative: text/html)/images"
- #
- # We could obtain easier code here, if 'alternative: text/html/images' would suffice.
- message.content_type "multipart/related"
- message.part do |p|
- p.text_part = textpart
- p.html_part = htmlpart
- end
- imgs.each do |i|
- message.attachments[i[:name]] = i
- end
- else
- # textpart/htmlpart are nil when not set
- # Mail then ignores them if nil; if both are given it sets multipart/alternative
- message.text_part = textpart
- message.html_part = htmlpart
- end
+
+ # textpart/htmlpart are nil when not set
+ # Mail then ignores them if nil; if both are given it sets multipart/alternative
+ message.text_part = textpart
+ message.html_part = htmlpart
+
return message.to_s
end