diff options
-rw-r--r-- | lib/rbot/botuser.rb | 16 |
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
|