aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-06-04 05:58:04 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2008-06-04 05:58:04 +0000
commitcef92d30d23586142f4aefe8ba75b2de6fff7144 (patch)
treef21fda96a71f697af97274120784c4e6af0a7a0a
parentDon't try to change the last seen ID if there are no new bugs. (diff)
downloadrbot-bugzilla-cef92d30d23586142f4aefe8ba75b2de6fff7144.tar.gz
rbot-bugzilla-cef92d30d23586142f4aefe8ba75b2de6fff7144.tar.bz2
rbot-bugzilla-cef92d30d23586142f4aefe8ba75b2de6fff7144.zip
Use m.replyto instead of m.channel so that users can have their own defaults.
-rw-r--r--bugzilla.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/bugzilla.rb b/bugzilla.rb
index eaf228d..7bf1ade 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -407,10 +407,10 @@ class BugzillaPlugin < Plugin
return if m.message !~ /\bbug\b.*\b#?([0-9]+)/
bugno = $1
- return unless @defaults[m.channel][:eavesdrop]
- return unless @defaults[m.channel][:zilla]
+ return unless @defaults[m.replyto][:eavesdrop]
+ return unless @defaults[m.replyto][:zilla]
- m.reply @defaults[m.channel][:zilla].summary(bugno)
+ m.reply @defaults[m.replyto][:zilla].summary(bugno)
end
# Function checking when a new channel is joined
@@ -420,8 +420,8 @@ class BugzillaPlugin < Plugin
return unless m.address?
@registry["channel_defaults"].each do |chanrexp, defaults|
- if m.channel.to_s =~ Regexp.new(chanrexp)
- @defaults[m.channel] = {
+ if m.replyto.to_s =~ Regexp.new(chanrexp)
+ @defaults[m.replyto] = {
:eavesdrop => defaults[:eavesdrop],
:zilla => @zillas[defaults[:zilla]]
}
@@ -443,8 +443,8 @@ class BugzillaPlugin < Plugin
if params[:zilla]
check_zilla(params[:zilla])
m.reply @zillas[params[:zilla]].summary(bugno)
- elsif @defaults[m.channel][:zilla]
- m.reply @defaults[m.channel][:zilla].summary(bugno)
+ elsif @defaults[m.replyto][:zilla]
+ m.reply @defaults[m.replyto][:zilla].summary(bugno)
else
m.reply "Wrong parameters, see 'help bug' for help."
end
@@ -491,8 +491,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.channel][:zilla]
- results = @defaults[m.channel][:zilla].report(query)
+ elsif @defaults[m.replyto][:zilla]
+ results = @defaults[m.replyto][:zilla].report(query)
msg = results.each { |b| " #{b[0]}(#{b[1]})" }
m.reply "#{title} #{msg}"
else