From 16047cb7fd337b09ad193fb3145163e1f4f00ec4 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Wed, 16 Apr 2008 06:42:02 +0000 Subject: Hide spam|test messages. git-svn-id: svn://svn.alpinelinux.org/acf/gnats/trunk@993 ab2d0c66-481e-0410-8bed-d214d4d58bed --- gnats-controller.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gnats-controller.lua b/gnats-controller.lua index 4fa036c..57eb3f3 100644 --- a/gnats-controller.lua +++ b/gnats-controller.lua @@ -378,6 +378,16 @@ function summary(self) -- Set the search criterias self.model:set_search_criteria(s) + local orgsummary = self.model:summary() + + -- Hide unwanted records + local summary = {} + for k,v in pairs(orgsummary) do + if not ((orgsummary[k]['state'] == "closed") and ((orgsummary[k]['category'] == "test") or (orgsummary[k]['category'] == "spam"))) then + table.insert(summary, v) + end + end + return { option={ script=ENV["SCRIPT_NAME"], prefix=self.conf.prefix, @@ -385,7 +395,7 @@ function summary(self) action = "edit", extra = "", }, - summary = self.model:summary(), + summary = summary, } end -- cgit v1.2.3