sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit cc2359bf87bd982501e57f703fbf4368b7f9cb5f
parent 269cd03b183669c86df1f7336ade8fff5c566ebd
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Sun,  1 Nov 2009 17:54:04 -0500

fix thread joining

Always save message refs when saving message state to disk.

Diffstat:
M lib/sup/ferret_index.rb | 5 ++++-
M lib/sup/xapian_index.rb | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/sup/ferret_index.rb b/lib/sup/ferret_index.rb
@@ -127,8 +127,11 @@ EOS
       :from => (m.from ? m.from.indexable_content : ""),
       :to => (m.to + m.cc + m.bcc).map { |x| x.indexable_content }.join(" "),
 
+      ## always overwrite :refs.
+      ## these might have changed due to manual thread joining.
+      :refs => (m.refs + m.replytos).uniq.join(" "),
+
       :subject => (entry[:subject] || wrap_subj(Message.normalize_subj(m.subj))),
-      :refs => (entry[:refs] || (m.refs + m.replytos).uniq.join(" ")),
     }
 
     @index_mutex.synchronize do
diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
@@ -114,7 +114,7 @@ EOS
       :cc => (entry[:cc] || m.cc.map { |p| [p.email, p.name] }),
       :bcc => (entry[:bcc] || m.bcc.map { |p| [p.email, p.name] }),
       :subject => m.subj,
-      :refs => (entry[:refs] || m.refs),
+      :refs => m.refs,
       :replytos => (entry[:replytos] || m.replytos),
     }