]> git.cworth.org Git - sup/commitdiff
revert that last change. aliases should be able to have spaces
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sat, 27 Oct 2007 19:08:21 +0000 (19:08 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sat, 27 Oct 2007 19:08:21 +0000 (19:08 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@623 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/contact.rb
lib/sup/modes/contact-list-mode.rb

index 2af0c5a6f1e364f5a2c9d4af97615492a6675680..ee3031a0ae6d52bc383e4a3ceb15da5e4d51fdcb 100644 (file)
@@ -1,7 +1,5 @@
 module Redwood
 
-class InvalidAliasError < StandardError; end
-
 class ContactManager
   include Singleton
 
@@ -25,8 +23,6 @@ class ContactManager
 
   def contacts; @p2a.keys; end
   def set_contact person, aalias
-    raise InvalidAliasError unless valid_alias? aalias
-
     if(pold = @a2p[aalias]) && (pold != person)
       drop_contact pold
     end
@@ -43,10 +39,6 @@ class ContactManager
   def alias_for person; @p2a[person]; end
   def is_contact? person; @p2a.member? person; end
 
-  def valid_alias? a
-    a =~ /^\S+$/
-  end
-
   def save
     File.open(@fn, "w") do |f|
       @p2a.each do |p, a|
index 9b52a597942cce2284b198c83748e3097dd745b0..86ae63ccffb54f3feaec5fb458a38affdd26a1ff 100644 (file)
@@ -6,11 +6,7 @@ module CanAliasContacts
     if a.empty?
       ContactManager.drop_contact p
     else
-      begin
-        ContactManager.set_contact p, a
-      rescue InvalidAliasError
-        BufferManager.flash "Error: nickname cannot contain spaces."
-      end
+      ContactManager.set_contact p, a
     end
   end
 end