summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-08-02 15:28:36 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-08-02 15:28:36 +0000
commit5940baa7fb81196925d692d4e4fe6d6cab73d1ed (patch)
tree787348f8d4739d0c46b94a60494ddafdf5929618
parentca1105be02e1baf867eaeb2c56049f87d8a9ecd3 (diff)
* Fixed the new http.proxy* settings, they work!
* Fixed a bug with auth-checking for the config module * misc tweaks
-rw-r--r--ChangeLog6
-rwxr-xr-xdocgen2
-rw-r--r--lib/rbot/auth.rb3
-rw-r--r--lib/rbot/config.rb3
-rw-r--r--lib/rbot/httputil.rb6
-rw-r--r--lib/rbot/ircbot.rb3
-rw-r--r--lib/rbot/messagemapper.rb6
-rw-r--r--rbot.gemspec5
8 files changed, 23 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index d470bae4..78d551bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/docgen b/docgen
index c7943409..a35bfc5d 100755
--- a/docgen
+++ b/docgen
@@ -1,3 +1,3 @@
#!/bin/sh
-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
diff --git a/lib/rbot/auth.rb b/lib/rbot/auth.rb
index ae7199e1..cc11a5a2 100644
--- a/lib/rbot/auth.rb
+++ b/lib/rbot/auth.rb
@@ -20,7 +20,8 @@ module Irc
# 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
diff --git a/lib/rbot/config.rb b/lib/rbot/config.rb
index a4522926..834b5a98 100644
--- a/lib/rbot/config.rb
+++ b/lib/rbot/config.rb
@@ -229,6 +229,7 @@ module Irc
value = params[:value].to_s
unless @@items.has_key?(key)
m.reply "no such config key #{key}"
+ return
end
begin
@@items[key].set_string(value)
@@ -263,7 +264,7 @@ module Irc
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
diff --git a/lib/rbot/httputil.rb b/lib/rbot/httputil.rb
index c6f51d8e..e234dc10 100644
--- a/lib/rbot/httputil.rb
+++ b/lib/rbot/httputil.rb
@@ -44,7 +44,7 @@ class HttpUtil
list = [uri.host]
begin
- list.push Resolv.getaddresses(uri.host)
+ list.concat Resolv.getaddresses(uri.host)
rescue StandardError => err
puts "warning: couldn't resolve host uri.host"
end
@@ -90,10 +90,10 @@ class HttpUtil
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"])
- 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}"
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index 6bdf7bdf..2dcede3e 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -71,6 +71,9 @@ class IrcBot
# 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.)
diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb
index 445b80f5..c8e2b6ba 100644
--- a/lib/rbot/messagemapper.rb
+++ b/lib/rbot/messagemapper.rb
@@ -29,15 +29,17 @@ module Irc
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
+ debug "auth failed for #{auth}"
# if it's just an auth failure but otherwise the match is good,
# don't try any more handlers
- break
+ return false
end
end
debug failures.inspect
diff --git a/rbot.gemspec b/rbot.gemspec
index 14e5cec8..c63f3836 100644
--- a/rbot.gemspec
+++ b/rbot.gemspec
@@ -28,9 +28,8 @@ spec = Gem::Specification.new do |s|
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.