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 f78f3b9 Docco
f78f3b9 is described below
commit f78f3b9e84fd7b1eb2336e45aa2dcb7dad319011
Author: Sebb <[email protected]>
AuthorDate: Mon Nov 15 17:12:44 2021 +0000
Docco
---
server/plugins/messages.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/server/plugins/messages.py b/server/plugins/messages.py
index fdd8dab..6be6a63 100644
--- a/server/plugins/messages.py
+++ b/server/plugins/messages.py
@@ -388,10 +388,13 @@ async def query(
if not session.credentials:
doc = anonymize(doc)
if not metadata_only:
+ # The body_short field is set to SHORT_BODY_MAX_LEN+1 if the
body is longer
+ # than SHORT_BODY_MAX_LEN, so we know if it has been truncated
if len(doc["body_short"] or "") > SHORT_BODY_MAX_LEN:
doc["body"] = doc["body_short"][:SHORT_BODY_MAX_LEN] +
'...'
else:
doc["body"] = doc["body_short"]
+ # stats.py is expecting doc['body'], not body_short
del doc["body_short"]
trim_email(doc)
docs.append(doc)