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 9138167 shorten parameter does nothing useful anymore
9138167 is described below
commit 91381675b19853cc83f976aa2b5f7215e78ce2a1
Author: Sebb <[email protected]>
AuthorDate: Mon Nov 15 16:47:45 2021 +0000
shorten parameter does nothing useful anymore
This fixes #134
---
server/endpoints/stats.py | 2 +-
server/plugins/messages.py | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/server/endpoints/stats.py b/server/endpoints/stats.py
index c243aaf..68a2aca 100644
--- a/server/endpoints/stats.py
+++ b/server/endpoints/stats.py
@@ -47,7 +47,7 @@ async def process(
except AssertionError as e: # If defuzzer encounters syntax errors, it
will throw an AssertionError
return aiohttp.web.Response(headers={"content-type": "text/plain",},
status=500, text=str(e))
results = await plugins.messages.query(
- session, query_defuzzed, query_limit=server.config.database.max_hits,
shorten=True,
+ session, query_defuzzed, query_limit=server.config.database.max_hits
)
# statsOnly: Whether to only send statistical info (for n-grams etc), and
not the
diff --git a/server/plugins/messages.py b/server/plugins/messages.py
index 0a95b67..fdd8dab 100644
--- a/server/plugins/messages.py
+++ b/server/plugins/messages.py
@@ -352,7 +352,6 @@ async def query(
session: plugins.session.SessionObject,
query_defuzzed,
query_limit=10000,
- shorten=False,
hide_deleted=True,
metadata_only=False,
epoch_order="desc"
@@ -389,7 +388,7 @@ async def query(
if not session.credentials:
doc = anonymize(doc)
if not metadata_only:
- if shorten and len(doc["body_short"] or "") >
SHORT_BODY_MAX_LEN:
+ 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"]