]> git.cworth.org Git - sup/blobdiff - lib/sup/message-chunks.rb
for message/rfc822 attachments, handle the case of no From: address (weird...)
[sup] / lib / sup / message-chunks.rb
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