diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | data/rbot/plugins/quakeauth.rb | 2 | ||||
-rw-r--r-- | lib/rbot/ircbot.rb | 13 | ||||
-rw-r--r-- | lib/rbot/message.rb | 2 |
4 files changed, 11 insertions, 11 deletions
@@ -1,3 +1,8 @@ +Sun Aug 21 13:29:55 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk> + + * fix for bug in quakenet plugin (trac #14) + * multiple fixes for unescaped bot nick in regexp's (trac #13) + Fri Aug 12 20:51:38 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk> * fix up autoop plugin a bit diff --git a/data/rbot/plugins/quakeauth.rb b/data/rbot/plugins/quakeauth.rb index 8f412f1d..dd1c884d 100644 --- a/data/rbot/plugins/quakeauth.rb +++ b/data/rbot/plugins/quakeauth.rb @@ -27,7 +27,7 @@ class QPlugin < Plugin end def set(m, params) - @registry['quakenet.user'] = params[:user] + @registry['quakenet.user'] = params[:nick] @registry['quakenet.auth'] = params[:passwd] m.okay end diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 29d4711d..68c2bd47 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -203,7 +203,7 @@ class IrcBot sourceurl = data[:sourceaddress] message = data[:message] m = QuitMessage.new(self, data[:source], data[:sourcenick], data[:message]) - if(data[:sourcenick] =~ /#{@nick}/i) + if(data[:sourcenick] =~ /#{Regexp.escape(@nick)}/i) else @channels.each {|k,v| if(v.users.has_key?(sourcenick)) @@ -255,7 +255,7 @@ class IrcBot onkick(m) } @client[:invite] = proc {|data| - if(data[:target] =~ /^#{@nick}$/i) + if(data[:target] =~ /^#{Regexp.escape(@nick)}$/i) join data[:channel] if (@auth.allow?("join", data[:source], data[:sourcenick])) end } @@ -500,11 +500,6 @@ class IrcBot end # attempt to change bot's nick to +name+ - # FIXME - # if rbot is already taken, this happens: - # <giblet> rbot_, nick rbot - # --- rbot_ is now known as rbot__ - # he should of course just keep his existing nick and report the error :P def nickchg(name) sendq "NICK #{name}" end @@ -707,9 +702,9 @@ class IrcBot else # stuff to handle when not addressed case m.message - when (/^\s*(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi|yo(\W|$))[\s,-.]+#{@nick}$/i) + when (/^\s*(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi|yo(\W|$))[\s,-.]+#{Regexp.escape(@nick)}$/i) say m.replyto, @lang.get("hello_X") % m.sourcenick - when (/^#{@nick}!*$/) + when (/^#{Regexp.escape(@nick)}!*$/) say m.replyto, @lang.get("hello_X") % m.sourcenick else @keywords.privmsg(m) diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb index ba5dcb43..eabb569a 100644 --- a/lib/rbot/message.rb +++ b/lib/rbot/message.rb @@ -141,7 +141,7 @@ module Irc # even if they used above prefixes, we allow for silly people who # combine all possible types, e.g. "|rbot: hello", or # "/msg rbot rbot: hello", etc - if @message.gsub!(/^\s*#{bot.nick}\s*([:;,>]|\s)\s*/, "") + if @message.gsub!(/^\s*#{Regexp.escape(bot.nick)}\s*([:;,>]|\s)\s*/, "") @address = true end |