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 ce737d6  only show warning if we haven't already searched for a parent.
     new bab277c  Merge branch 'master' of 
github.com:apache/incubator-ponymail-foal
ce737d6 is described below

commit ce737d62fead3a4cfe44f75ab70f8120b93c98b2
Author: Daniel Gruno <[email protected]>
AuthorDate: Mon Nov 15 19:34:01 2021 +0100

    only show warning if we haven't already searched for a parent.
---
 webui/js/ponymail.js                | 3 ++-
 webui/js/source/construct-thread.js | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 6dc9322..64d60aa 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -901,6 +901,7 @@ function construct_single_thread(state, json) {
     div.innerHTML = "";
 
     // Fix URLs if they point to an deprecated permalink
+    let looked_for_parent = location.href.match(/find_parent/) ? true : false;
     if (json.thread) {
         let url_to_push = location.href.replace(/[^/]+$/, "") + json.thread.id;
         if (location.href != url_to_push) {
@@ -910,7 +911,7 @@ function construct_single_thread(state, json) {
     }
 
     // Not top level thread?
-    if (json.thread['in-reply-to'] && json.thread['in-reply-to'].length > 0) {
+    if (!looked_for_parent && json.thread['in-reply-to'] && 
json.thread['in-reply-to'].length > 0) {
         let notice = new HTML("span", {style: {color: "saddlebrown", 
background: 'white', padding: "1px"}}, "This email appears to be a reply to 
another email. If you wish to attempt finding the root thread, click here: ");
         let a = new HTML("a", {href: "javascript:void(location.href += 
'&find_parent=true');"}, "Find parent email");
         div.inject(notice);
diff --git a/webui/js/source/construct-thread.js 
b/webui/js/source/construct-thread.js
index 481778b..2da6b62 100644
--- a/webui/js/source/construct-thread.js
+++ b/webui/js/source/construct-thread.js
@@ -126,6 +126,7 @@ function construct_single_thread(state, json) {
     div.innerHTML = "";
 
     // Fix URLs if they point to an deprecated permalink
+    let looked_for_parent = location.href.match(/find_parent/) ? true : false;
     if (json.thread) {
         let url_to_push = location.href.replace(/[^/]+$/, "") + json.thread.id;
         if (location.href != url_to_push) {
@@ -135,7 +136,7 @@ function construct_single_thread(state, json) {
     }
 
     // Not top level thread?
-    if (json.thread['in-reply-to'] && json.thread['in-reply-to'].length > 0) {
+    if (!looked_for_parent && json.thread['in-reply-to'] && 
json.thread['in-reply-to'].length > 0) {
         let notice = new HTML("span", {style: {color: "saddlebrown", 
background: 'white', padding: "1px"}}, "This email appears to be a reply to 
another email. If you wish to attempt finding the root thread, click here: ");
         let a = new HTML("a", {href: "javascript:void(location.href += 
'&find_parent=true');"}, "Find parent email");
         div.inject(notice);

Reply via email to