From d371c081ebe557cbe67b2428f75c9471a480e8ef Mon Sep 17 00:00:00 2001 From: William Morgan Date: Wed, 20 Feb 2008 09:37:50 -0800 Subject: [PATCH] bugfix: ThreadSet claiming non-relevant videos are actually relevant The call to @messages[mid] was a mistake because @messages is a SavingHash. This was inserting spurious entries into @messages, which then caused ThreadSet#relevant? to return true for any non-first messages in a thread (the first one would be falsely added to @messages) --- lib/sup/thread.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sup/thread.rb b/lib/sup/thread.rb index 09fbfbb..f7fb39e 100644 --- a/lib/sup/thread.rb +++ b/lib/sup/thread.rb @@ -259,7 +259,7 @@ class ThreadSet @thread_by_subj = thread_by_subj end - def thread_for_id mid; (c = @messages[mid]) && c.root.thread end + def thread_for_id mid; @messages.member?(mid) && @messages[mid].root.thread end def contains_id? id; @messages.member?(id) && !@messages[id].empty? end def thread_for m; thread_for_id m.id end def contains? m; contains_id? m.id end -- 2.45.2