Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/IMAP
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-03-01 21:45:23 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-03-01 21:47:43 +0300
commit0b249c188181110a4f2ecb6ec4a9d91fef041579 (patch)
tree03815667318ef5ea230a1030a4dd11061b6ef80c /lib/IMAP
parent73efd7dab4e3a2f202df31d38ac69b049dc02c0e (diff)
Do now allow messages to be their own parents in threading
A message may send its own ID in the `references` header. In that case the threading algorithm must ignore the closed loop and not set the message as its own parent, to prevent an infinite loop later when checking for anchestors. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/IMAP')
-rw-r--r--lib/IMAP/Threading/ThreadBuilder.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/IMAP/Threading/ThreadBuilder.php b/lib/IMAP/Threading/ThreadBuilder.php
index 84bcc8cb3..2b3c18f82 100644
--- a/lib/IMAP/Threading/ThreadBuilder.php
+++ b/lib/IMAP/Threading/ThreadBuilder.php
@@ -114,7 +114,7 @@ class ThreadBuilder {
// Step 1.C
//$parentId = $message->getReferences()[count($message->getReferences()) - 1] ?? null;
//$container->setParent($idTable[$parentId] ?? null);
- if ($parent === null || !$parent->hasAncestor($container)) {
+ if (($parent === null || !$parent->hasAncestor($container)) && $container !== $parent) {
$container->setParent($parent);
}
}