This is an automated email from the ASF dual-hosted git repository.

humbedooh 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 b4c6d4c  Only add "Re: " if needed
b4c6d4c is described below

commit b4c6d4cca3d03a48739766b2a758dc4fb025e076
Author: Daniel Gruno <[email protected]>
AuthorDate: Sat Nov 13 16:25:43 2021 +0100

    Only add "Re: " if needed
---
 webui/js/ponymail.js        | 5 ++++-
 webui/js/source/composer.js | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 26917fd..91a2c5f 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -652,7 +652,10 @@ function compose_email(replyto, list) {
     let eml_body = "";
     let eml_title = `Start a new thread on ${listname}:`;
     if (email) {
-        eml_subject = "Re: " + email.subject;
+        eml_subject = email.subject;
+        if (!eml_subject.match(/^Re:\s+/i)) {  // Add "Re: " if needed only.
+            eml_subject = "Re: " + eml_subject;
+        }
         eml_body = composer_re(email);
         eml_title = `Reply to email on ${listname}:`;
     }
diff --git a/webui/js/source/composer.js b/webui/js/source/composer.js
index 5b88ef6..a80555c 100644
--- a/webui/js/source/composer.js
+++ b/webui/js/source/composer.js
@@ -66,7 +66,10 @@ function compose_email(replyto, list) {
     let eml_body = "";
     let eml_title = `Start a new thread on ${listname}:`;
     if (email) {
-        eml_subject = "Re: " + email.subject;
+        eml_subject = email.subject;
+        if (!eml_subject.match(/^Re:\s+/i)) {  // Add "Re: " if needed only.
+            eml_subject = "Re: " + eml_subject;
+        }
         eml_body = composer_re(email);
         eml_title = `Reply to email on ${listname}:`;
     }

Reply via email to