Sha256: 0fc1408f2b577f59591a7a3c3ece4b6c6ceb6891cce3b5296e9660a030fa3a91

Contents?: true

Size: 747 Bytes

Versions: 3

Compression:

Stored size: 747 Bytes

Contents

module Redwood

class PersonSearchResultsMode < ThreadIndexMode
  register_keymap do |k|
    k.add :load_more_threads, "Load #{LOAD_MORE_THREAD_NUM} more threads", 'M'
  end

  def initialize people
    @people = people
    super
  end

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

  def load_more_threads n=ThreadIndexMode::LOAD_MORE_THREAD_NUM
    load_n_threads_background n, :participants => @people,
                                 :load_killed => true,
                                 :load_spam => false,
                                 :when_done =>(lambda do |num|
      if num > 0
        BufferManager.flash "Found #{num} threads"
      else
        BufferManager.flash "No matches"
      end
    end)
  end
end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sup-0.0.1 lib/sup/modes/person-search-results-mode.rb
sup-0.0.2 lib/sup/modes/person-search-results-mode.rb
sup-0.0.3 lib/sup/modes/person-search-results-mode.rb