lib/sup/modes/search-results-mode.rb in sup-0.0.8 vs lib/sup/modes/search-results-mode.rb in sup-0.1

- old
+ new

@@ -1,28 +1,17 @@ module Redwood class SearchResultsMode < ThreadIndexMode def initialize qobj @qobj = qobj - super + super [], { :qobj => @qobj, :load_killed => true, :load_spam => false } end - ## TODO: think about this - def is_relevant? m; super; end + ## a proper is_relevant? method requires some way of asking ferret + ## if an in-memory object satisfies a query. i'm not sure how to do + ## that yet. in the worst case i can make an in-memory index, add + ## the message, and search against it to see if i have > 0 results, + ## but that seems pretty insane. - def load_threads opts={} - n = opts[:num] || ThreadIndexMode::LOAD_MORE_THREAD_NUM - load_n_threads_background n, :qobj => @qobj, - :load_killed => true, - :load_spam => false, - :when_done =>(lambda do |num| - opts[:when_done].call if opts[:when_done] - if num > 0 - BufferManager.flash "Found #{num} threads" - else - BufferManager.flash "No matches" - end - end) - end end end