From: wmorgan Date: Mon, 10 Dec 2007 02:58:30 +0000 (+0000) Subject: make tag-matching-threads better X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=d1aa68cd75b38f459332f518ce9fdf5000e3a38e;p=sup make tag-matching-threads better git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@757 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index be5fc8e..9c507cb 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -359,7 +359,7 @@ EOS query = BufferManager.ask :search, "tag threads matching: " return if query.nil? || query.empty? query = /#{query}/i - @mutex.synchronize { @threads.each { |t| @tags.tag t if thread_match?(t, query) } } + @mutex.synchronize { @threads.each { |t| @tags.tag t if thread_matches?(t, query) } } regen_text end @@ -496,8 +496,8 @@ protected ## used to tag threads by query. this can be made a lot more sophisticated, ## but for right now we'll do the obvious this. - def thread_match? t, query - t.snippet =~ query || t.participants.any? { |x| x.longname =~ query } + def thread_matches? t, query + t.subject =~ query || t.snippet =~ query || t.participants.any? { |x| x.longname =~ query } end def size_widget_for_thread t