From: wmorgan Date: Thu, 28 Dec 2006 23:34:31 +0000 (+0000) Subject: whoohoo! thread index loading is completely from index now (no need to read X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=1b74e0714885128d0fdcc93c5ab1959bc140104a;p=sup 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 --- diff --git a/lib/sup/index.rb b/lib/sup/index.rb index 3151f3b..5c1e2e4 100644 --- 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 => <