* Fixed a bug with auth-checking for the config module
* misc tweaks
+Tue Aug 02 16:27:36 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
+
+ * Fixed the new http.proxy* settings, they work!
+ * Fixed a bug with auth-checking for the config module
+ * misc tweaks
+
Sun Jul 31 02:20:08 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
* Updated docgen to generate rdoc again with the new repo structure
Sun Jul 31 02:20:08 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
* Updated docgen to generate rdoc again with the new repo structure
-rdoc -a -i 'lib' --exclude '(data/|setup.rb|post-config.rb|rbotconfig.rb|timertest.rb)' --main lib/rbot/ircbot.rb -o doc lib bin
+rdoc -a -i 'lib' --exclude '(post-config.rb|rbotconfig.rb)' --main lib/rbot/ircbot.rb -o doc lib bin/rbot
# on hostmask and userlevel.
class IrcAuth
BotConfig.register BotConfigStringValue.new('auth.password',
# on hostmask and userlevel.
class IrcAuth
BotConfig.register BotConfigStringValue.new('auth.password',
- :default => "Your password for maxing your auth with the bot (used to associate new hostmasks with your owner-status etc)")
+ :default => "rbotauth", :wizard => true,
+ :desc => "Your password for maxing your auth with the bot (used to associate new hostmasks with your owner-status etc)")
# create a new IrcAuth instance.
# bot:: associated bot class
# create a new IrcAuth instance.
# bot:: associated bot class
value = params[:value].to_s
unless @@items.has_key?(key)
m.reply "no such config key #{key}"
value = params[:value].to_s
unless @@items.has_key?(key)
m.reply "no such config key #{key}"
end
begin
@@items[key].set_string(value)
end
begin
@@items[key].set_string(value)
end
end
def usage(m,params)
end
end
def usage(m,params)
- m.reply "incorrect usage, try '#{@bot.nick}: help config'"
+ m.reply "incorrect usage, try '#{@@bot.nick}: help config'"
end
# bot:: parent bot class
end
# bot:: parent bot class
- list.push Resolv.getaddresses(uri.host)
+ list.concat Resolv.getaddresses(uri.host)
rescue StandardError => err
puts "warning: couldn't resolve host uri.host"
end
rescue StandardError => err
puts "warning: couldn't resolve host uri.host"
end
if @bot.config["http.use_proxy"]
if (ENV['http_proxy'])
if @bot.config["http.use_proxy"]
if (ENV['http_proxy'])
- proxy = URI.parse ENV['http_proxy']
+ proxy = URI.parse ENV['http_proxy'] rescue nil
end
if (@bot.config["http.proxy_uri"])
end
if (@bot.config["http.proxy_uri"])
- proxy = URI.parse ENV['http_proxy_uri']
+ proxy = URI.parse @bot.config["http.proxy_uri"] rescue nil
end
if proxy
debug "proxy is set to #{proxy.uri}"
end
if proxy
debug "proxy is set to #{proxy.uri}"
# channel info for channels the bot is in
attr_reader :channels
# channel info for channels the bot is in
attr_reader :channels
+ # bot's irc socket
+ attr_reader :socket
+
# bot's object registry, plugins get an interface to this for persistant
# storage (hash interface tied to a bdb file, plugins use Accessors to store
# and restore objects in their own namespaces.)
# bot's object registry, plugins get an interface to this for persistant
# storage (hash interface tied to a bdb file, plugins use Accessors to store
# and restore objects in their own namespaces.)
else
action = route.options[:action] ? route.options[:action] : route.items[0]
next unless @parent.respond_to?(action)
else
action = route.options[:action] ? route.options[:action] : route.items[0]
next unless @parent.respond_to?(action)
- auth = route.options[:auth] ? route.options[:auth] : action
+ auth = route.options[:auth] ? route.options[:auth] : route.items[0]
+ debug "checking auth for #{auth}"
if m.bot.auth.allow?(auth, m.source, m.replyto)
debug "route found and auth'd: #{action.inspect} #{options.inspect}"
@parent.send(action, m, options)
return true
end
if m.bot.auth.allow?(auth, m.source, m.replyto)
debug "route found and auth'd: #{action.inspect} #{options.inspect}"
@parent.send(action, m, options)
return true
end
+ debug "auth failed for #{auth}"
# if it's just an auth failure but otherwise the match is good,
# don't try any more handlers
# if it's just an auth failure but otherwise the match is good,
# don't try any more handlers
end
end
debug failures.inspect
end
end
debug failures.inspect
s.autorequire = 'rbot/ircbot'
s.has_rdoc = true
s.rdoc_options = ['--include', 'lib', '--exclude',
s.autorequire = 'rbot/ircbot'
s.has_rdoc = true
s.rdoc_options = ['--include', 'lib', '--exclude',
- '(post-config.rb|rbotconfig.rb)'
- '--title', 'rbot API Documentation', '--main', 'lib/rbot/ircbot.rb',
- 'lib', 'bin/rbot']
+ '(post-config.rb|rbotconfig.rb)', '--title', 'rbot API Documentation',
+ '--main', 'lib/rbot/ircbot.rb', 'lib', 'bin/rbot']
#### Author and project details.
#### Author and project details.