]> git.mxchange.org Git - friendica.git/commitdiff
Mail: real threading now works with outgoing mails.
authorMichael Vogel <icarus@dabo.de>
Wed, 19 Dec 2012 15:31:06 +0000 (16:31 +0100)
committerMichael Vogel <icarus@dabo.de>
Wed, 19 Dec 2012 15:31:06 +0000 (16:31 +0100)
include/delivery.php
include/notifier.php
include/onepoll.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']),
index c522bcb6bc1ec00c457b51a0e5aadd26525c3e02..b5a92ff2526c5675e8825307fb9fec403b5a24f5 100644 (file)
@@ -790,7 +790,13 @@ function notifier_run(&$argv, &$argc){
                                                $headers .= 'Message-Id: <' . iri2msgid($it['uri']) . '>' . "\n";
 
                                                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']),
index 2abd41b7898d9bb14669f72ac604d0e11b15f067..c493aff76270e12a96e9ce1569e4a9a54c979aa9 100644 (file)
@@ -335,7 +335,7 @@ function onepoll_run(&$argv, &$argc){
                                                                        intval($r[0]['id'])
                                                                );
                                                        }
-                                                       /*switch ($mailconf[0]['action']) {
+                                                       switch ($mailconf[0]['action']) {
                                                                case 0:
                                                                        logger("Mail: Seen before ".$msg_uid." for ".$mailconf[0]['user'].". Doing nothing.", LOGGER_DEBUG);
                                                                        break;
@@ -353,7 +353,7 @@ function onepoll_run(&$argv, &$argc){
                                                                        if ($mailconf[0]['movetofolder'] != "")
                                                                                imap_mail_move($mbox, $msg_uid, $mailconf[0]['movetofolder'], FT_UID);
                                                                        break;
-                                                       }*/
+                                                       }
                                                        continue;
                                                }