]> git.cworth.org Git - sup/commitdiff
whoohoo! thread index loading is completely from index now (no need to read
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 28 Dec 2006 23:34:31 +0000 (23:34 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 28 Dec 2006 23:34:31 +0000 (23:34 +0000)
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

lib/sup/index.rb
lib/sup/message.rb

index 3151f3b43719f4b60750c6b264c26074b81fe2d6..5c1e2e4090c5694eb1f64e6fa6e95f4f3e95ea5f 100644 (file)
@@ -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
index f3ad31d7ea05bf2b4a420aeb82acbda6d2a0c81d..3106fa5aa1682c35530ab22161c9a870740eead8 100644 (file)
@@ -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]