]> git.notmuchmail.org Git - sup/commitdiff
escape emails with @ signs in them, and don't store in people.txt addresses where...
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sat, 27 Oct 2007 01:55:52 +0000 (01:55 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sat, 27 Oct 2007 01:55:52 +0000 (01:55 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@617 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/person.rb

index 78eace9993e106435125b05fc4693f1b3913acfd..f5cbe5391085c328398d6e14ea6392a5a48be19e 100644 (file)
@@ -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>"