summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/itemtomail.rb20
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/feed2imap/itemtomail.rb b/lib/feed2imap/itemtomail.rb
index 455a136..55bf9d8 100644
--- a/lib/feed2imap/itemtomail.rb
+++ b/lib/feed2imap/itemtomail.rb
@@ -100,24 +100,8 @@ def item_to_mail(config, item, id, updated, from = 'Feed2Imap', inline_images =
# $2 contains url, $3 the image name, $4 the image extension
begin
fetcher = HTTPFetcher.new
- image = Base64.encode64(fetcher.fetch($2, Time.at(0)).chomp) + "\n"
- cid = "#{Digest::MD5.hexdigest($2)}@#{config.hostname}"
- if not cids.include?(cid)
- cids << cid
- imgpart = RMail::Message.new
- imgpart.header.set('Content-ID', "<#{cid}>")
- type = $4
- type = 'jpeg' if type.downcase == 'jpg' # hack hack hack
- imgpart.header.set('Content-Type', "image/#{type}", 'name' => $3)
- imgpart.header.set('Content-Disposition', 'attachment', 'filename' => $3)
- imgpart.header.set('Content-Transfer-Encoding', 'base64')
- imgpart.body = image
- imgs << imgpart
- end
- # now to specify what to replace with
- newtag = "#{$1}src=\"cid:#{cid}\"#{$5}"
- #print "#{cid}: Replacing '#{$&}' with '#{newtag}'...\n"
- newtag
+ image = Base64.encode64(fetcher.fetch($2, Time.at(0)).chomp)
+ "#{$1}src=\"data:image/#{$4};base64,#{image}\"#{$5}"
rescue
#print "Error while fetching image #{$2}: #{$!}...\n"
$& # don't modify on exception
/td> 2008-07-03Removed XSD_LOCATION -- as there is no more xsd ;)René 'Necoro' Neumann2-5/+1 2008-07-03Updated setup.py to install the correct set of pluginsRené 'Necoro' Neumann1-3/+2 2008-07-03Ported etc-proposals pluginRené 'Necoro' Neumann3-50/+43 2008-07-03Ported gpytage pluginRené 'Necoro' Neumann2-16/+14 2008-07-03Ported Notify pluginRené 'Necoro' Neumann4-37/+51 2008-07-03Remove xsd and -x cmdline optionRené 'Necoro' Neumann2-107/+1 2008-07-03Ported completelyRené 'Necoro' Neumann3-548/+54 2008-07-03Should show dependencies nowRené 'Necoro' Neumann2-82/+128 2008-07-03New plugin system - first hackRené 'Necoro' Neumann2-420/+683 2008-06-30Now the new design is able to do the same as the old oneRené 'Necoro' Neumann3-168/+182 2008-06-30First draft of the new plugin windowRené 'Necoro' Neumann1-8/+172 2008-06-30Added stuff to plugin.pyRené 'Necoro' Neumann1-2/+24 2008-06-25Now load 22 versions when running the correct portageRené 'Necoro' Neumann4-8/+18 2008-06-25Added Package_22 and System_22René 'Necoro' Neumann4-5/+63