summaryrefslogtreecommitdiff
path: root/lib/rbot/botuser.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-15 22:25:22 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-15 22:25:22 +0000
commite858505dbad9060ce743b10269b60ec3282bf387 (patch)
treef29e4332015cab7a1afae180ee216c9a03e5e5e4 /lib/rbot/botuser.rb
parent8fdc4283433cf3e8969e728dbd3f17b3da63d65a (diff)
New Auth Framework: catch possible error when trying to create transient botuser
Diffstat (limited to 'lib/rbot/botuser.rb')
-rw-r--r--lib/rbot/botuser.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/rbot/botuser.rb b/lib/rbot/botuser.rb
index 7a00f277..83fb2624 100644
--- a/lib/rbot/botuser.rb
+++ b/lib/rbot/botuser.rb
@@ -757,13 +757,21 @@ class Bot
end
# Creates a new transient BotUser associated with Irc::User _user_,
- # automatically logging him in
+ # automatically logging him in. Note that transient botuser creation can
+ # fail, typically if we don't have the complete user netmask (e.g. for
+ # messages coming in from a linkbot)
#
def create_transient_botuser(user)
ircuser = user.to_irc_user
- bu = BotUser.new(ircuser, :transient => true, :masks => ircuser)
- bu.login(ircuser)
- @transients << bu
+ bu = everyone
+ begin
+ bu = BotUser.new(ircuser, :transient => true, :masks => ircuser)
+ bu.login(ircuser)
+ @transients << bu
+ rescue
+ warning "failed to create transient for #{user}"
+ error $!
+ end
return bu
end