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: An unauthorised private mail should be treated like a non-existent mail
Date Sat, 17 Dec 2016 23:42:56 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master b8f04d038 -> 60b8bac89


An unauthorised private mail should be treated like a non-existent mail 

This fixes #295

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

Branch: refs/heads/master
Commit: 60b8bac893355482b7b2a2f994a0b9dde03f242a
Parents: b8f04d0
Author: Sebb <sebb@apache.org>
Authored: Sat Dec 17 23:42:42 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Sat Dec 17 23:42:42 2016 +0000

----------------------------------------------------------------------
 CHANGELOG.md        | 2 +-
 site/api/email.lua  | 9 ++-------
 site/api/source.lua | 8 +++-----
 site/api/thread.lua | 7 +------
 4 files changed, 7 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/60b8bac8/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 32b325b..56ee724 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -83,7 +83,7 @@
 - preferences.lua should not return list data if it was not requested (#305)
 - preferences.lua should not update the user account if the mail is not sent OK (#306)
 - alts.js does not check for errors when calling preferences.lua (#304)
-
+- An unauthorised private mail should be treated like a non-existent mail (#295)
 
 ## CHANGES in 0.9b:
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/60b8bac8/site/api/email.lua
----------------------------------------------------------------------
diff --git a/site/api/email.lua b/site/api/email.lua
index d5921f1..8654224 100644
--- a/site/api/email.lua
+++ b/site/api/email.lua
@@ -125,16 +125,11 @@ function handle(r)
                 end      
                 doc.gravatar = r:md5(eml:lower())
                 r:puts(JSON.encode(doc))
+                return cross.OK
             end
-        else
-            r:puts(JSON.encode{
-                    error = "You do not have access to view this email, sorry."
-                })
-            return cross.OK
         end
-    else
-        r:puts[[{}]]
     end
+    r:puts[[{"No such e-mail or you do not have access to it."}]]
     return cross.OK
 end
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/60b8bac8/site/api/source.lua
----------------------------------------------------------------------
diff --git a/site/api/source.lua b/site/api/source.lua
index 64275ac..f0e8710 100644
--- a/site/api/source.lua
+++ b/site/api/source.lua
@@ -44,14 +44,12 @@ function handle(r)
             if doc_raw then
                 r:puts(doc_raw.source)
             else
-                r:puts("No such email")
+                r:puts("Could not find the email source, sorry!")
             end
-        else
-            r:puts("You do not have access to view this email, sorry.")
+            return cross.OK
         end
-    else
-        r:puts[[No such email, sorry!]]
     end
+    r:puts[[No such email, or you don't have access. Sorry!]]
     return cross.OK
 end
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/60b8bac8/site/api/thread.lua
----------------------------------------------------------------------
diff --git a/site/api/thread.lua b/site/api/thread.lua
index 8e8422a..62039f7 100644
--- a/site/api/thread.lua
+++ b/site/api/thread.lua
@@ -124,15 +124,10 @@ function handle(r)
                 thread = doc,
                 emails = emls_thrd,
             }))
-        else
-            r:puts(JSON.encode{
-                    error = "You do not have access to view this email, sorry."
-                })
             return cross.OK
         end
-    else
-        r:puts[[{}]]
     end
+    r:puts[[{"No such e-mail or you do not have access to it."}]]
     return cross.OK
 end
 


Mime
View raw message