This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new b24e434  Allow showQuery unless disabled
b24e434 is described below

commit b24e4348977ad5e12cfbc4564b5e71c61780647e
Author: Sebb <[email protected]>
AuthorDate: Fri Oct 8 10:43:16 2021 +0100

    Allow showQuery unless disabled
---
 site/api/lib/config.lua.sample | 2 +-
 site/api/stats.lua             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/site/api/lib/config.lua.sample b/site/api/lib/config.lua.sample
index 0e97bcd..0acb615 100644
--- a/site/api/lib/config.lua.sample
+++ b/site/api/lib/config.lua.sample
@@ -38,6 +38,6 @@ local config = {
 --  listsDisplay = 'regex', -- if defined, hide list names that don't match 
the regex
 --  debug = false, -- whether to return debug information
     antispam = true,  -- Whether or not to add anti-spam measures aimed at 
anonymous users.
-    showQuery = 'ondemand', -- return query in JSON result: always|ondemand
+    noShowQuery = false, -- disallow return query in JSON result: true|false 
(default false)
 }
 return config
diff --git a/site/api/stats.lua b/site/api/stats.lua
index 3a99318..240f1ee 100644
--- a/site/api/stats.lua
+++ b/site/api/stats.lua
@@ -781,7 +781,7 @@ function handle(r)
     end
     listdata.numparts = allparts
     listdata.unixtime = os.time()
-    if config.showQuery == 'always' or (config.showQuery == 'ondemand' and 
get.showQuery) then
+    if get.showQuery and not config.noShowQuery then
         listdata.squery = squery
     end
     

Reply via email to