summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/botuser.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rbot/botuser.rb b/lib/rbot/botuser.rb
index de77093a..defb3a47 100644
--- a/lib/rbot/botuser.rb
+++ b/lib/rbot/botuser.rb
@@ -810,8 +810,9 @@ class Bot
# BotUser (if any) it's logged in as
#
def make_permanent(user, name)
+ buname = BotUser.sanitize_username(name)
# TODO merge BotUser instead?
- raise "there's already a BotUser called #{name}" if include?(name)
+ raise "there's already a BotUser called #{name}" if include?(buname)
tuser = nil
case user
@@ -825,7 +826,7 @@ class Bot
return nil unless tuser
raise TypeError, "#{tuser} is not transient" unless tuser.transient?
- tuser.make_permanent(name)
+ tuser.make_permanent(buname)
@allbotusers[tuser.username.to_sym] = tuser
return tuser