]> git.cworth.org Git - sup/commitdiff
bugfix: properly choose root messages for threading by subject
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 30 Dec 2007 04:28:23 +0000 (20:28 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 30 Dec 2007 05:04:56 +0000 (21:04 -0800)
lib/sup/thread.rb

index 4d92ad3dfb1efe4fab37cc41a616aeeef5052755..6519757c467295095c47cdcd45b3fd5332f6e5f2 100644 (file)
@@ -58,7 +58,7 @@ class Thread
   ## messages).
   def each fake_root=false
     adj = 0
-    root = @containers.find_all { |c| !Message.subj_is_reply?(c) }.argmin { |c| c.date || 0 }
+    root = @containers.find_all { |c| c.message && !Message.subj_is_reply?(c.message.subj) }.argmin { |c| c.date }
 
     if root
       adj = 1