You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/03/29 13:10:48 UTC

[incubator-ponymail-foal] 11/19: don't show email if deleted/hidden

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

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

commit aac2f6a7848cdf8dcd2056358ca11b776ddff3ec
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Mar 29 11:39:56 2021 +0200

    don't show email if deleted/hidden
---
 server/endpoints/email.py  | 2 +-
 server/endpoints/source.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/endpoints/email.py b/server/endpoints/email.py
index 97b60dd..fb534a4 100644
--- a/server/endpoints/email.py
+++ b/server/endpoints/email.py
@@ -41,7 +41,7 @@ async def process(
         email = await plugins.mbox.get_email(session, messageid=indata.get("id"))
 
     # If email was found, process the request if we are allowed to display it
-    if email and isinstance(email, dict):
+    if email and isinstance(email, dict) and not email.get("deleted"):
         if plugins.aaa.can_access_email(session, email):
             # Are we fetching an attachment?
             if not indata.get("attachment"):
diff --git a/server/endpoints/source.py b/server/endpoints/source.py
index 78bddbe..44bbcc5 100644
--- a/server/endpoints/source.py
+++ b/server/endpoints/source.py
@@ -36,7 +36,7 @@ async def process(
     if email is None:
         email = await plugins.mbox.get_email(session, messageid=indata.get("id"))
     
-    if email and isinstance(email, dict):
+    if email and isinstance(email, dict) and not email.get("deleted"):
         if plugins.aaa.can_access_email(session, email):
             source = await plugins.mbox.get_source(session, permalink=email["mid"])
             if source: