]> git.cworth.org Git - sup/commitdiff
make tag-matching-threads better
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 10 Dec 2007 02:58:30 +0000 (02:58 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 10 Dec 2007 02:58:30 +0000 (02:58 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@757 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/thread-index-mode.rb

index be5fc8e7f1a960592fb92deac611d81299f7e1f0..9c507cb965073d5defcf9853e19a0e20c14d286e 100644 (file)
@@ -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