Subject: [sup-talk] Can't figure out how to use aliases

From: [email-masked] (Steve Goldman)
Date: Wed, 05 Nov 2008 10:08:09 -0500

I can't get sup to replace an alias with its email address when I send
To: an alias.  This is really confusing.

Thanks.
-- 

Steve Goldman
sgoldman at tower-research.com

T: 212.219.6014
F: 212.219.6007

Tower Research Capital, LLC
377 Broadway, 11th Fl.
New York, NY 10013

---

From: [email-masked] (William Morgan)
Date: Thu, 06 Nov 2008 11:49:47 -0800

> To: an alias.  This is really confusing.

This should happen automagically, if you enter the alias either when
Sup prompts you, or if it's on a To/Cc/Bcc line when you exit the editor
and return to Sup.

Are you sure you're typing in the right alias?
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Steve Goldman)
Date: Thu, 06 Nov 2008 15:15:15 -0500

Testing it out, it seems to be a casing issue.  When the alias I
choose is all lowercase, it works.  Looks like when sup throws me into
my editor to compose the email, it lower cases the entire alias.  Then
when it comes back out, it can't match the lower cased alias if the
alias had upper case letters.

-- 

Steve Goldman

T: 212.219.6014
F: 212.219.6007

---

From: [email-masked] (Steve Goldman)
Date: Fri, 07 Nov 2008 13:46:07 -0500

diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index ebc3587..0447f61 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -506,7 +506,7 @@ EOS
     answer = BufferManager.ask_many_emails_with_completions domain, question, completions, default

     if answer
-      answer.split_on_commas.map { |x| ContactManager.contact_for(x.downcase) || PersonManager.person_for(x) }
+      answer.split_on_commas.map { |x| ContactManager.contact_for(x) || PersonManager.person_for(x) }
     end
   end

We shouldn't downcase names before we look them up in the alias to
person hash since the keys of that hash are case sensitive.  This
brings up a more philosophical question of whether keys in that hash
SHOULD be case sensitive.  What does it mean to have two aliases
"Steve" and "steve"?

-- 

Steve Goldman

T: 212.219.6014
F: 212.219.6007