X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fsup%2Fmessage-chunks.rb;h=40e098f2914e8c606d69c95a62234a53c12b9f10;hb=38b3d2167248fd42b7057edf3036215937fe2ed4;hp=b3726923a85e31fdc7993c7efa5287035751a8d4;hpb=41e0712333ff391ab4b0ef1b307b1e013e4e20ae;p=sup diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb index b372692..40e098f 100644 --- a/lib/sup/message-chunks.rb +++ b/lib/sup/message-chunks.rb @@ -45,7 +45,10 @@ module Chunk class Attachment HookManager.register "mime-decode", < content_type, :filename => lambda { write_to_disk }, @@ -108,7 +120,7 @@ EOS if expandable? "Attachment: #{filename} (#{lines.length} lines)" else - "Attachment: #{filename} (#{content_type})" + "Attachment: #{filename} (#{content_type}; #{@raw_content.size.to_human_size})" end end @@ -119,9 +131,9 @@ EOS def initial_state; :open end def viewable?; @lines.nil? end def view_default! path - cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}' 2>/dev/null" - Redwood::log "running: #{cmd.inspect}" - system cmd + cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}'" + debug "running: #{cmd.inspect}" + BufferManager.shell_out(cmd) $? == 0 end @@ -228,8 +240,8 @@ EOS def patina_color case status - when :valid: :cryptosig_valid_color - when :invalid: :cryptosig_invalid_color + when :valid then :cryptosig_valid_color + when :invalid then :cryptosig_invalid_color else :cryptosig_unknown_color end end