diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | Rakefile | 2 | ||||
-rw-r--r-- | lib/rbot/ircbot.rb | 7 | ||||
-rw-r--r-- | lib/rbot/message.rb | 6 |
4 files changed, 15 insertions, 8 deletions
@@ -1,3 +1,11 @@ +Sun Aug 07 15:11:07 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk> + + * fix address_prefix, broken in 0.9.9, reported by ruskie. + +Sat Aug 06 00:54:34 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk> + + * Released 0.9.9 + Fri Aug 05 23:55:20 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk> * few more tweaks preparing to release 0.9.9 @@ -2,7 +2,7 @@ require 'rubygems' require 'rake' require 'rake/gempackagetask' -task :default => [:package] +task :default => [:repackage] spec = Gem::Specification.new do |s| s.name = 'rbot' diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index a6a7ab53..7cfda371 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -153,11 +153,6 @@ class IrcBot @socket = IrcSocket.new(@config['server.name'], @config['server.port'], @config['server.bindhost'], @config['server.sendq_delay'], @config['server.sendq_burst']) @nick = @config['irc.nick'] - if @config['core.address_prefix'] - @addressing_prefixes = @config['core.address_prefix'].split(" ") - else - @addressing_prefixes = Array.new - end @client = IrcClient.new @client[:privmsg] = proc { |data| @@ -711,7 +706,7 @@ class IrcBot else # stuff to handle when not addressed case m.message - when (/^\s*(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi(\W|$)|yo(\W|$))[\s,-.]+#{@nick}$/i) + when (/^\s*(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi|yo(\W|$))[\s,-.]+#{@nick}$/i) say m.replyto, @lang.get("hello_X") % m.sourcenick when (/^#{@nick}!*$/) say m.replyto, @lang.get("hello_X") % m.sourcenick diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb index d7f614ab..ba5dcb43 100644 --- a/lib/rbot/message.rb +++ b/lib/rbot/message.rb @@ -1,4 +1,8 @@ module Irc + BotConfig.register BotConfigArrayValue.new('core.address_prefix', + :default => [], :wizard => true, + :desc => "what non nick-matching prefixes should the bot respond to as if addressed (e.g !, so that '!foo' is treated like 'rbot: foo')" + ) # base user message class, all user messages derive from this # (a user message is defined as having a source hostmask, a target @@ -127,7 +131,7 @@ module Irc # check for option extra addressing prefixes, e.g "|search foo", or # "!version" - first match wins - bot.addressing_prefixes.each {|mprefix| + bot.config['core.address_prefix'].each {|mprefix| if @message.gsub!(/^#{Regexp.escape(mprefix)}\s*/, "") @address = true break |