sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 624298c1da52ee295e7468583385eac659ef6070
parent 71edc7b75f80a4f0ea9e5ad65f1b6a7b4ab5a807
Author: Eric Sherman <hyperbolist@gmail.com>
Date:   Thu, 21 Jan 2010 10:36:28 -0500

show (recipients) instead of lone "me"

I've changed thread-index-mode to show recipients in () parens instead
of "me" in the From field for threads from me with no replies.

I've developed the habit of archiving a new thread as soon as I send it,
so until I receive a reply it's effectively non-existent.  When checking
on emails I may want to follow up on with a search like "is:sent AND
after:(14 days ago) AND before:(3 days ago)" I would get a pile of lone
"me"'s in the From field.  I would then open each of them to decide
whether or not to follow up based on who it was sent to.

So this helps me cut down on the jx loops in that scenario.

I'm not sure if this is something that is universally desirable, but
here's the patch anyway.

Diffstat:
M lib/sup/modes/thread-index-mode.rb | 10 ++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -793,6 +793,16 @@ protected
       result << [name, new[a]]
     end
 
+    if result.size == 1 && (author_and_newness = result.assoc("me"))
+      unless (recipients = t.participants - t.authors).empty?
+        result = recipients.collect do |r|
+          break if limit && result.size >= limit
+          name = (recipients.size == 1) ? r.mediumname : r.shortname
+          ["(#{name})", author_and_newness[1]]
+        end
+      end
+    end
+
     result
   end