ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: Simplify; merge account checks
Date Wed, 14 Dec 2016 01:22:39 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master dccaf070a -> 1021641c7


Simplify; merge account checks

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

Branch: refs/heads/master
Commit: 1021641c77e42fb99829c085639518f6c2a03b50
Parents: dccaf07
Author: Sebb <sebb@apache.org>
Authored: Wed Dec 14 01:22:28 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Wed Dec 14 01:22:28 2016 +0000

----------------------------------------------------------------------
 site/api/stats.lua | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/1021641c/site/api/stats.lua
----------------------------------------------------------------------
diff --git a/site/api/stats.lua b/site/api/stats.lua
index 20b10d0..eeed145 100644
--- a/site/api/stats.lua
+++ b/site/api/stats.lua
@@ -575,19 +575,20 @@ function handle(r)
     for k = #dhh, 1, -1 do
         local v = dhh[k]
         local email = v._source
-        local canUse = true
         local eepoch = tonumber(email.epoch)
         if eepoch > lastEmail then
             lastEmail = eepoch
         end
+        local canUse = false
         if email.private then
-            if account and not rights then
-                rights = aaa.rights(r, account)
-            end
-            canUse = false
             if account then
+                if not rights then
+                    rights = aaa.rights(r, account)
+                end
                 canUse = utils.canAccessDoc(email, rights)
             end
+        else
+            canUse = true
         end
         if canUse then
 


Mime
View raw message