diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2008-06-04 07:28:11 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2008-06-04 07:28:11 +0000 |
commit | ddb4d2d95c00499be76d4a084b5e9787ea148d11 (patch) | |
tree | 5e926fa973126f81c5ca5b25a8e5020e0b74b4fd /bugzilla.rb | |
parent | Fix defaults_show for now. (diff) | |
download | rbot-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.rb | 30 |
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 # |