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-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new 6bbb4f4  Better to trim before anonymising
6bbb4f4 is described below

commit 6bbb4f49c99a22962afe7953b5fa06dfea341ec2
Author: Sebb <[email protected]>
AuthorDate: Wed Nov 10 15:26:53 2021 +0000

    Better to trim before anonymising
---
 server/plugins/messages.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/plugins/messages.py b/server/plugins/messages.py
index d87ae69..5ee4717 100644
--- a/server/plugins/messages.py
+++ b/server/plugins/messages.py
@@ -243,9 +243,9 @@ async def get_email(
         doc = doc["_source"]
         doc["id"] = doc["mid"]
         if doc and plugins.aaa.can_access_email(session, doc):
+            trim_email(doc)
             if not session.credentials:
                 doc = anonymize(doc)
-            trim_email(doc)
             return doc
 
     # multi-doc return?
@@ -255,9 +255,9 @@ async def get_email(
             doc = doc["_source"]
             doc["id"] = doc["mid"]
             if doc and plugins.aaa.can_access_email(session, doc):
+                trim_email(doc)
                 if not session.credentials:
                     doc = anonymize(doc)
-                trim_email(doc)
                 docs_returned.append(doc)
         return docs_returned
     # no doc?

Reply via email to