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 a2e909e Sort and document fields returned
a2e909e is described below
commit a2e909edd4ae57d6010ca227c00462d1ec72587e
Author: Sebb <[email protected]>
AuthorDate: Wed Nov 10 15:03:27 2021 +0000
Sort and document fields returned
No code change
---
server/plugins/messages.py | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/server/plugins/messages.py b/server/plugins/messages.py
index fa46d0a..d87ae69 100644
--- a/server/plugins/messages.py
+++ b/server/plugins/messages.py
@@ -45,21 +45,26 @@ mbox_cache_privacy: typing.Dict[str, bool] = {}
BODY_MAXLEN = 200 # TODO: make this a config item
+# Only these fields are returned by the API:
+# (keep this list sorted)
USED_UI_FIELDS = [
- "private",
- "list",
- "list_raw",
"attachments",
+ "body",
+ "children",
+ "epoch",
"from",
+ "gravatar",
+ "id",
+ "list_raw",
+ "list",
"message-id",
"mid",
- "body",
- "epoch",
+ "private",
"subject",
- "id",
- "gravatar",
- "children",
]
+# The following fields are currently excluded:
+# from_raw, permalinks, dbid, date, references, in-reply-to, html_source_only,
forum, size, to, cc
+# The body_short contents may replace the body contents, but it is not
returned separately
def trim_email(doc, external=False):