]> git.mxchange.org Git - friendica.git/blobdiff - include/delivery.php
Mail: real threading now works with outgoing mails.
[friendica.git] / include / delivery.php
index e8bf338a8f9a488be97e01d77a70e090bd734472..fcb0ee47b987b9b7521ec72f6f91da9d8b990429 100644 (file)
@@ -481,7 +481,13 @@ function delivery_run(&$argv, &$argc){
                                        //logger("Mail: Data: ".print_r($it, true), LOGGER_DATA);
 
                                        if($it['uri'] !== $it['parent-uri']) {
-                                               $headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n";
+                                               $headers .= "References: <".iri2msgid($it["parent-uri"]).">";
+
+                                               // If Threading is enabled, write down the correct parent
+                                               if (($it["thr-parent"] != "") and ($it["thr-parent"] != $it["parent-uri"]))
+                                                       $headers .= " <".iri2msgid($it["thr-parent"]).">";
+                                               $headers .= "\n";
+
                                                if(!$it['title']) {
                                                        $r = q("SELECT `title` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
                                                                dbesc($it['parent-uri']),