]> git.cworth.org Git - sup/commitdiff
for message/rfc822 attachments, handle the case of no From: address (weird...)
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 28 Oct 2007 00:35:26 +0000 (00:35 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 28 Oct 2007 00:35:26 +0000 (00:35 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@633 5c8cc53c-5e98-4d25-b20a-d8db53a31250

doc/TODO
lib/sup/message-chunks.rb
lib/sup/message.rb

index 1e7fb55b14c84fa56e62a92f7678c726c2537d6b..d25d1a791fdc6fcc1eda78dda1aabbbc2fdf87b0 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -8,6 +8,7 @@ _ bugfix: sent.mbox and >From
 _ bugfix: tokenized email addresses (amazon.com, etc)
 x bugfix: trailing spaces in buffermanager.ask
 x bugfix: need to URL-unescape maildir folders
+x bugfix: downcasing tab completion
 x warnings: top-posting, missing attachment
 x hookability
 
index 9168aa7c51d703e39abfaf06d72572e5dc97e813..6da21aac4629fa1da44cdd4873e7a30b40d8e510 100644 (file)
@@ -146,19 +146,23 @@ EOS
   end
 
   class EnclosedMessage
-    attr_reader :from, :lines
+    attr_reader :lines
     def initialize from, body
       @from = from
       @lines = body.split "\n"
     end
 
+    def from
+      @from ? @from.longname : "unknown sender"
+    end
+
     def inlineable?; false end
     def expandable?; true end
     def initial_state; :open end
     def viewable?; false end
 
     def patina_color; :generic_notice_patina_color end
-    def patina_text; "Begin enclosed message from #{@from.longname} (#{@lines.length} lines)" end
+    def patina_text; "Begin enclosed message from #{from} (#{@lines.length} lines)" end
 
     def color; :quote_color end
   end
index 568179d4f7543bd7be1664991feabecde693258e..13a41aa077b544f8ce49a858a227242a4df1ed35 100644 (file)
@@ -325,7 +325,9 @@ private
       chunks
     elsif m.header.content_type == "message/rfc822"
       payload = RMail::Parser.read(m.body)
-      [Chunk::EnclosedMessage.new(PersonManager.person_for(payload.header.from.first.format), payload.to_s)]
+      from = payload.header.from.first
+      from_person = from ? PersonManager.person_for(from.format) : nil
+      [Chunk::EnclosedMessage.new(from_person, payload.to_s)]
     else
       filename =
         ## first, paw through the headers looking for a filename