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 f6c1c91 Only try again if we need to
f6c1c91 is described below
commit f6c1c91ec1c65809ad1310dabd582516b4bf7baa
Author: Sebb <[email protected]>
AuthorDate: Sun Nov 28 12:13:17 2021 +0000
Only try again if we need to
Unfortunately this won't always work...
---
server/endpoints/thread.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/server/endpoints/thread.py b/server/endpoints/thread.py
index 48e7545..9ef79ce 100644
--- a/server/endpoints/thread.py
+++ b/server/endpoints/thread.py
@@ -30,8 +30,11 @@ async def process(
email = await plugins.messages.get_email(session, permalink=mailid)
if not email:
email = await plugins.messages.get_email(session, messageid=mailid)
- if not email:
- mailid = mailid.replace(" ", "+") # Some Message-IDs have + in them,
this can confuse since + means space.
+ # The id is passed via the path thread/id
+ # This means that + is converted into space
+ # So we need to try both space and '+', and hope no msg ids contain both
+ if not email and ' ' in mailid: # only try again if we need to
+ mailid = mailid.replace(" ", "+")
email = await plugins.messages.get_email(session, messageid=mailid)
if not email:
return None