aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-06-04 06:02:04 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2008-06-04 06:02:04 +0000
commitf04f875fb6004bcdf7ad96e471c4a46172d1030d (patch)
treeb88546de64f65884cdd8a8ebcfc35ed9606c5e01
parentAllow unset of defaults for users. (diff)
downloadrbot-bugzilla-f04f875fb6004bcdf7ad96e471c4a46172d1030d.tar.gz
rbot-bugzilla-f04f875fb6004bcdf7ad96e471c4a46172d1030d.tar.bz2
rbot-bugzilla-f04f875fb6004bcdf7ad96e471c4a46172d1030d.zip
More functions for defaults.
-rw-r--r--bugzilla.rb35
1 files changed, 34 insertions, 1 deletions
diff --git a/bugzilla.rb b/bugzilla.rb
index f4cc73c..1a2f102 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -629,6 +629,26 @@ class BugzillaPlugin < Plugin
end
end
+ # Display the list of channels/users for which we have defaults
+ def channel_defaults_list(m, params)
+ begin
+ m.reply 'Inside channel_defaults_list'
+ @defaults.each_key { |k| m.reply k }
+ rescue ::Exception => e
+ m.reply e.message
+ end
+ end
+
+ # Show the default for a given channel/user
+ def channel_defaults_show(m, params)
+ begin
+ defl = @defaults[params[:channel]]
+ m.reply "#{params[:channel]}: #{defl}"
+ rescue ::Exception => e
+ m.reply e.message
+ end
+ end
+
# Adds announcement for bugs on the given zilla to the channel
#
# When this function is called, the given zilla is added to the list
@@ -686,9 +706,11 @@ class BugzillaPlugin < Plugin
"zilla instance list" => "zilla instance list : shows current querable bugzilla instancess",
"zilla instance show" => "zilla instance show #{Bold}name#{Bold} : shows the configuration for the named bugzilla.",
- "zilla default" => "zilla default #{Bold}set#{Bold}|#{Bold}unset#{Bold} : handles default zilla for channels",
+ "zilla default" => "zilla default #{Bold}set#{Bold}|#{Bold}unset#{Bold}|#{Bold}list#{Bold}|#{Bold}show#{Bold} : handles default zilla for channels",
"zilla default set" => "zilla default set #{Bold}channel_name#{Bold} #{Bold}zilla_name#{Bold} #{Bold}eavesdrop_on|off#{Bold} : sets the default zilla for a given channel, use on or off to enable or disable eavesdropping for bug references.",
"zilla default unset" => "zilla default unset #{Bold}channel_name#{Bold} : unsets the default zilla for a given channel",
+ "zilla default list" => "zilla default list : shows all channels for which a default is set",
+ "zilla default show" => "zilla default show #{Bold}channel_name#{Bold} : show the default for a given channel",
"zilla source" => "zilla source : shows a link to the plugin's sources.",
"zilla credits" => "zilla credits : shows the plugin's credits and license."
@@ -794,6 +816,17 @@ plugin.map 'zilla default unset :channel',
},
:auth_path => 'modify'
+plugin.map 'zilla default list',
+ :action => 'channel_defaults_list',
+ :auth_path => 'view'
+
+plugin.map 'zilla default show :channel',
+ :action => 'channel_defaults_show',
+ :requirements => {
+ :channel => /^[^ ]+$/
+ },
+ :auth_path => 'view'
+
plugin.map 'zilla announcement add :zilla :channel',
:action => 'channel_announcement_add',
:requirements => {