diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2008-06-03 06:14:04 +0000 |
---|---|---|
committer | root <root@speedracer.orbis-terrarum.net> | 2008-06-03 06:14:04 +0000 |
commit | 3a8393eaaa8694560d29b52f2c5d782fb0d2b9d8 (patch) | |
tree | eb5d08869be561a8529095bf45351a9759fa7cd4 | |
parent | Add my name to the authors, i've written enough code. (diff) | |
parent | Move plugin_source and plugin_credits at the end of the class. (diff) | |
download | rbot-bugzilla-3a8393eaaa8694560d29b52f2c5d782fb0d2b9d8.tar.gz rbot-bugzilla-3a8393eaaa8694560d29b52f2c5d782fb0d2b9d8.tar.bz2 rbot-bugzilla-3a8393eaaa8694560d29b52f2c5d782fb0d2b9d8.zip |
Merge branch 'master' of git://git.flameeyes.eu/rbot-bugzilla
Conflicts:
bugzilla.rb
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | bugzilla.rb | 31 |
2 files changed, 22 insertions, 13 deletions
@@ -9,7 +9,7 @@ the requested bug, and then shows a summary line on the channel or the query where it was requested. A default set of configured Bugzilla installations can be found in the -bugzillaplugin.db file in this tarball, this includes Bugzilla +Berkeley DB dump file in this tarball, this includes Bugzilla installations for: Gentoo, xine, Linux kernel, KDE, GNOME, SourceMage Linux, Mozilla, FreeDesktop, Netbeans, SpamAssassin, Eclipse, Apache, GCC, atheme (Audacious and other projects), Novell and RedHat. @@ -40,4 +40,4 @@ at your option, any later version). For this reason, the "zilla source" download will report the URL where to download the source. If you make any change to the source code, you should then make them -available, and change the link_source function accordingly. +available, and change the plugin_source function accordingly. diff --git a/bugzilla.rb b/bugzilla.rb index 2e8bf18..bb42ae8 100644 --- a/bugzilla.rb +++ b/bugzilla.rb @@ -169,7 +169,6 @@ class BugzillaPlugin < Plugin end def lastseenid - return 0 unless @registry["zilla.#{name}.lastseenid"] return @registry["zilla.#{name}.lastseenid"] end @@ -291,7 +290,16 @@ class BugzillaPlugin < Plugin end def announce(bot) - buglist = CSV::Reader.create(client.get_content("#{baseurl}/buglist.cgi?ctype=csv&field0-0-0=bug_id&query_format=advaced&remaction=&type0-0-0=greaterthan&value0-0-0=#{lastseenid}&order=bugs.bug_id")).to_a + buglist_url = baseurl + + "/buglist.cgi?ctype=csv&order=bugs.bug_id" + + if lastseenid == nil + buglist_url += "&chfieldfrom=-6h&chfieldto=Now&chfield=%5BBug+creation%5D" + else + buglist_url += "&field0-0-0=bug_id&remaction=&type0-0-0=greaterthan&value0-0-0=#{lastseenid}" + end + + buglist = CSV::Reader.create(client.get_content(buglist_url)).to_a buglist.delete_at(0) upper_bound = [buglist.size, 5].min buglist[-upper_bound..-1].each do |bug| @@ -302,7 +310,7 @@ class BugzillaPlugin < Plugin end end - lastseenid = buglist[-1][0].to_i + self.lastseenid = buglist[-1][0].to_i end def report(params) @@ -583,14 +591,6 @@ class BugzillaPlugin < Plugin end end - def plugin_sources(m, params) - m.reply "http://www.flameeyes.eu/projects#rbot-bugzilla" - end - - def plugin_credits(m, params) - m.reply "Copyright (C) 2005-2008 Diego Pettenò & Robin H. Johnson. Distributed under Affero General Public License version 3." - 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 @@ -661,6 +661,15 @@ class BugzillaPlugin < Plugin return "no help available for #{cmd}" end end + + def plugin_sources(m, params) + m.reply "http://www.flameeyes.eu/projects#rbot-bugzilla" + end + + def plugin_credits(m, params) + m.reply "Copyright (C) 2005-2008 Diego Pettenò & Robin H. Johnson. Distributed under Affero General Public License version 3." + end + end plugin = BugzillaPlugin.new |