diff options
author | 2008-06-04 07:30:58 +0000 | |
---|---|---|
committer | 2008-06-04 07:30:58 +0000 | |
commit | b13a2df3b1c5218c96585156ec179ce07f0535f0 (patch) | |
tree | f548e30f09f8a88f69eecd5ea2b4574194df7491 | |
parent | Redoing of reload function. (diff) | |
download | rbot-bugzilla-b13a2df3b1c5218c96585156ec179ce07f0535f0.tar.gz rbot-bugzilla-b13a2df3b1c5218c96585156ec179ce07f0535f0.tar.bz2 rbot-bugzilla-b13a2df3b1c5218c96585156ec179ce07f0535f0.zip |
Change how @defaults stores the data. No duplicate zilla reference anymore, just a string.
-rw-r--r-- | bugzilla.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bugzilla.rb b/bugzilla.rb index 4c90814..b96396b 100644 --- a/bugzilla.rb +++ b/bugzilla.rb @@ -409,8 +409,9 @@ class BugzillaPlugin < Plugin return unless @defaults[m.replyto][:eavesdrop] return unless @defaults[m.replyto][:zilla] + return unless @zillas[@defaults[m.replyto][:zilla]] - m.reply @defaults[m.replyto][:zilla].summary(bugno) + m.reply @zillas[@defaults[m.replyto][:zilla]].summary(bugno) end # Function checking when a new channel is joined @@ -443,8 +444,8 @@ class BugzillaPlugin < Plugin if params[:zilla] check_zilla(params[:zilla]) m.reply @zillas[params[:zilla]].summary(bugno) - elsif @defaults[m.replyto][:zilla] - m.reply @defaults[m.replyto][:zilla].summary(bugno) + elsif @defaults[m.replyto][:zilla] and @zillas[@defaults[m.replyto][:zilla]] + m.reply @zillas[@defaults[m.replyto][:zilla]].summary(bugno) else m.reply "Wrong parameters, see 'help bug' for help." end @@ -491,8 +492,8 @@ class BugzillaPlugin < Plugin results = @zillas[params[:zilla]].report(query) msg = results.each { |b| " #{b[0]}(#{b[1]})" } m.reply "#{title} #{msg}" - elsif @defaults[m.replyto][:zilla] - results = @defaults[m.replyto][:zilla].report(query) + elsif @defaults[m.replyto][:zilla] and @zillas[@defaults[m.replyto][:zilla]] + results = @zillas[@defaults[m.replyto][:zilla]].report(query) msg = results.each { |b| " #{b[0]}(#{b[1]})" } m.reply "#{title} #{msg}" else @@ -619,7 +620,7 @@ class BugzillaPlugin < Plugin def _channel_defaults_reload_set(chan, defaults) @defaults[chan] = { :eavesdrop => defaults[:eavesdrop], - :zilla => @zillas[defaults[:zilla]] + :zilla => defaults[:zilla] } end |