Sha256: 33947d49f5ed507099b6773b2171649960a08aeb3af2eac942e8815ddcff372a

Contents?: true

Size: 707 Bytes

Versions: 4

Compression:

Stored size: 707 Bytes

Contents

module Redwood

class PersonSearchResultsMode < ThreadIndexMode
  def initialize people
    @people = people
    super
  end

  def is_relevant? m; @people.any? { |p| m.from == p }; end

  def load_threads opts={}
    n = opts[:num] || ThreadIndexMode::LOAD_MORE_THREAD_NUM
    load_n_threads_background n, :participants => @people,
                                 :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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sup-0.0.5 lib/sup/modes/person-search-results-mode.rb
sup-0.0.6 lib/sup/modes/person-search-results-mode.rb
sup-0.0.7 lib/sup/modes/person-search-results-mode.rb
sup-0.0.8 lib/sup/modes/person-search-results-mode.rb