lib/sup/thread.rb in sup-0.0.1 vs lib/sup/thread.rb in sup-0.0.2
- old
+ new
@@ -5,10 +5,11 @@
class Thread
include Enumerable
attr_reader :containers
def initialize
+ raise "wrong thread, buddy!" if block_given?
@containers = []
end
def << c
@containers << c
@@ -319,10 +320,11 @@
if oldroot.thread
# puts "*** root (#{root.subj}) == oldroot (#{oldroot.subj}); ignoring"
else
## to disable subject grouping, use the next line instead
## (and the same for below)
+ #Redwood::log "[1] normalized subject for #{id} is #{Message.normalize_subj(root.subj)}"
thread = (@subj_thread[Message.normalize_subj(root.subj)] ||= Thread.new)
#thread = (@subj_thread[root.id] ||= Thread.new)
thread << root
root.thread = thread
@@ -339,9 +341,10 @@
if root.thread
# puts "*** IGNORING cuz root already has a thread"
else
## to disable subject grouping, use the next line instead
## (and the same above)
+ #Redwood::log "[2] normalized subject for #{id} is #{Message.normalize_subj(root.subj)}"
thread = (@subj_thread[Message.normalize_subj(root.subj)] ||= Thread.new)
#thread = (@subj_thread[root.id] ||= Thread.new)
thread << root
root.thread = thread