sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 08dd2c336202942e0ee256471fcec4dc3f8897af
parent 61699ac30b5866e1458abe6359f8b0f21ec2c498
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Sat, 27 Oct 2007 01:55:52 +0000

escape emails with @ signs in them, and don't store in people.txt addresses where the name is the same as the email (no point)

git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@617 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M lib/sup/person.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/sup/person.rb b/lib/sup/person.rb
@@ -20,6 +20,7 @@ class PersonManager
   def save
     File.open(@fn, "w") do |f|
       @@people.each do |email, p|
+        next if p.email == p.name
         f.puts "#{p.email}: #{p.timestamp} #{p.name}"
       end
     end
@@ -114,7 +115,7 @@ class Person
 
   def full_address
     if @name && @email
-      if @name =~ /[",]/
+      if @name =~ /[",@]/
         "#{@name.inspect} <#@email>" # escape quotes
       else
         "#@name <#@email>"