You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2016/12/07 10:59:41 UTC

[1/2] incubator-ponymail git commit: Comments

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 5f2c7d6ef -> 7f5502e46


Comments

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/c27733f7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/c27733f7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/c27733f7

Branch: refs/heads/master
Commit: c27733f78c818bb0e136cc54ab0a04e4c0b9b962
Parents: 5f2c7d6
Author: Sebb <se...@apache.org>
Authored: Tue Dec 6 16:16:28 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Tue Dec 6 16:16:28 2016 +0000

----------------------------------------------------------------------
 site/api/preferences.lua | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/c27733f7/site/api/preferences.lua
----------------------------------------------------------------------
diff --git a/site/api/preferences.lua b/site/api/preferences.lua
index 510170c..d80cedd 100644
--- a/site/api/preferences.lua
+++ b/site/api/preferences.lua
@@ -216,6 +216,7 @@ Pony Mail - Email for Ponies and People.
     if cache then
         lists = JSON.decode(cache)
     else
+        -- get all the list names
         local doc = elastic.raw {
             size = 0, -- we don't need the hits themselves
             aggs = {
@@ -227,7 +228,7 @@ Pony Mail - Email for Ponies and People.
                 }
             }
         }
-        
+        -- get list names with messages in the last 90 days
         local ndoc = elastic.raw {
             size = 0, -- we don't need the hits themselves
             aggs = {
@@ -245,7 +246,7 @@ Pony Mail - Email for Ponies and People.
             }
         }
         
-        
+        -- init the lists with the names (no counts)
         for x,y in pairs (doc.aggregations.from.buckets) do
             local list, domain = y.key:lower():match("^<?(.-)%.(.-)>?$")
             if domain and domain:match("^[-_a-z0-9.]+$") and #domain > 3 and list:match("^[-_a-z0-9.]+$") then
@@ -253,6 +254,7 @@ Pony Mail - Email for Ponies and People.
                 lists[domain][list] = 0
             end
         end
+        -- add the counts of recent mails
         for x,y in pairs (ndoc.aggregations.from.buckets) do
             local list, domain = y.key:lower():match("^<?(.-)%.(.-)>?$")
             if domain and domain:match("^[-_a-z0-9.]+$") and #domain > 3 and list:match("^[-_a-z0-9.]+$") then
@@ -275,6 +277,7 @@ Pony Mail - Email for Ponies and People.
         if cache then
             pdoc = JSON.decode(cache)
         else
+            -- get list names which have at least one private message in the last 20 years
             pdoc = elastic.raw {
                 size = 0, -- we don't need the hits themselves
                 aggs = {
@@ -309,6 +312,9 @@ Pony Mail - Email for Ponies and People.
         if account then
             rights = aaa.rights(r, account)
         end
+        -- remove any lists containing mails that the user is not allowed to access
+        -- N.B. this removes mixed lists
+        -- i.e. the user won't see the list name if it contains a single private mail they cannot access
         for x,y in pairs (pdoc.aggregations.from.buckets) do
             local canAccess = false
             local list, domain = y.key:lower():match("^<?(.-)%.(.-)>?$")


[2/2] incubator-ponymail git commit: Not used

Posted by se...@apache.org.
Not used

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/7f5502e4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/7f5502e4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/7f5502e4

Branch: refs/heads/master
Commit: 7f5502e46c95d5e4d7e1d7f5866e59198e4cf00e
Parents: c27733f
Author: Sebb <se...@apache.org>
Authored: Tue Dec 6 22:32:24 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Tue Dec 6 22:32:24 2016 +0000

----------------------------------------------------------------------
 site/api/pminfo.lua | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/7f5502e4/site/api/pminfo.lua
----------------------------------------------------------------------
diff --git a/site/api/pminfo.lua b/site/api/pminfo.lua
index ad0c3eb..99995fc 100644
--- a/site/api/pminfo.lua
+++ b/site/api/pminfo.lua
@@ -27,7 +27,6 @@ function handle(r)
     local now = r:clock()
     local tnow = now
     local get = r:parseargs()
-    local qs = "*"
     local domain = get.domain or ""
     if #domain < 2 then
         domain = "*"