sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 1b74e0714885128d0fdcc93c5ab1959bc140104a
parent fdaf7d52bc7f110f2790931d280f63f4e56405ed
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Thu, 28 Dec 2006 23:34:31 +0000

whoohoo! thread index loading is completely from index now (no need to read
from sources), so it is FAST FAST FAST!!!

only when we load an individual message does it go to the source.



git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@116 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M lib/sup/index.rb | 20 ++++++++++----------
M lib/sup/message.rb | 2 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/lib/sup/index.rb b/lib/sup/index.rb
@@ -189,6 +189,15 @@ class Index
     #puts "building message #{doc[:message_id]} (#{source}##{doc[:source_info]})"
     raise "invalid source #{doc[:source_id]}" unless source
 
+    fake_header = {
+      "date" => Time.at(doc[:date].to_i),
+      "subject" => unwrap_subj(doc[:subject]),
+      "from" => doc[:from],
+      "to" => doc[:to],
+      "message-id" => doc[:message_id],
+      "references" => doc[:refs],
+    }
+
     m = 
       if source.broken?
         nil
@@ -196,7 +205,7 @@ class Index
         begin
           Message.new :source => source, :source_info => doc[:source_info].to_i, 
                       :labels => doc[:label].split(" ").map { |s| s.intern },
-                      :snippet => doc[:snippet]
+                      :snippet => doc[:snippet], :header => fake_header
         rescue MessageFormatError => e
           raise IndexError.new(source, "error building message #{doc[:message_id]} at #{source}/#{doc[:source_info]}: #{e.message}")
         rescue SourceError => e
@@ -205,15 +214,6 @@ class Index
       end
 
     unless m
-      fake_header = {
-        "date" => Time.at(doc[:date].to_i),
-        "subject" => unwrap_subj(doc[:subject]),
-        "from" => doc[:from],
-        "to" => doc[:to],
-        "message-id" => doc[:message_id],
-        "references" => doc[:refs],
-      }
-
       m = Message.new :labels => doc[:label].split(" ").map { |s| s.intern },
                       :snippet => doc[:snippet], :header => fake_header, 
                       :body => <<EOS
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -86,7 +86,7 @@ class Message
 
   bool_reader :dirty
 
-  ## if index_entry is specified, will fill in values from that,
+  ## if index_entry is specified, will fill in values from that
   def initialize opts
     if opts[:source]
       @source = opts[:source]