aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-06-04 07:28:11 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2008-06-04 07:28:11 +0000
commitddb4d2d95c00499be76d4a084b5e9787ea148d11 (patch)
tree5e926fa973126f81c5ca5b25a8e5020e0b74b4fd /bugzilla.rb
parentFix defaults_show for now. (diff)
downloadrbot-bugzilla-ddb4d2d95c00499be76d4a084b5e9787ea148d11.tar.gz
rbot-bugzilla-ddb4d2d95c00499be76d4a084b5e9787ea148d11.tar.bz2
rbot-bugzilla-ddb4d2d95c00499be76d4a084b5e9787ea148d11.zip
Redoing of reload function.
Diffstat (limited to 'bugzilla.rb')
-rw-r--r--bugzilla.rb30
1 files changed, 26 insertions, 4 deletions
diff --git a/bugzilla.rb b/bugzilla.rb
index 6bf00bd..4c90814 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -591,15 +591,37 @@ class BugzillaPlugin < Plugin
@bot.server.channels.each do |chan|
@registry["channel_defaults"].each do |chanrexp, defaults|
if chan.to_s =~ Regexp.new(chanrexp)
- @defaults[chan] = {
- :eavesdrop => defaults[:eavesdrop],
- :zilla => @zillas[defaults[:zilla]]
- }
+ _channel_defaults_reload_set(chan, defaults)
break
end
end
end
end
+# New version for later
+# def channel_defaults_reload
+# begin
+# match = false
+# if chanrexp =~ /^\/.*\/$/
+# chanrexp = Regexp.new(chanrexp[1..-2])
+# @bot.server.channels.each do |chan|
+# _channel_defaults_reload_set(chan, defaults) if chan.to_s =~ chanrexp
+# end
+# else
+# _channel_defaults_reload_set(chanrexp, defaults)
+# end
+# end
+# rescue ::Exception => e
+# debug(e.message + "\n" + e.backtrace.join("\n\t"))
+# end
+# end
+
+ # Helper function only
+ def _channel_defaults_reload_set(chan, defaults)
+ @defaults[chan] = {
+ :eavesdrop => defaults[:eavesdrop],
+ :zilla => @zillas[defaults[:zilla]]
+ }
+ end
# Sets the default zilla for the given channel regexp
#