]> git.mxchange.org Git - friendica.git/commitdiff
Mail: Subject are now with working "Re:"
authorMichael Vogel <icarus@dabo.de>
Sun, 11 Mar 2012 23:22:12 +0000 (00:22 +0100)
committerMichael Vogel <icarus@dabo.de>
Sun, 11 Mar 2012 23:22:12 +0000 (00:22 +0100)
include/delivery.php
include/notifier.php

index 41869988dc86262a091ee9e12d4a3f7e7caf9464..44a482ca28945368718d0c1be408a6f88df35ca4 100755 (executable)
@@ -446,30 +446,16 @@ function delivery_run($argv, $argc){
 
                                if($it['uri'] !== $it['parent-uri']) {
                                        $headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n";
-                                       if(! strlen($it['title'])) {
+                                       if(!strlen($it['title'])) {
                                                $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' LIMIT 1",
-                                                       dbesc($it['parent-uri'])
-                                               );
-                                               if(count($r)) {
-                                                       $subtitle = $r[0]['title'];
-                                                       if($subtitle) {
-                                                               if(strncasecmp($subtitle,'RE:',3))
-                                                                       $subject = $subtitle;
-                                                               else
-                                                                       $subject = 'Re: ' . $subtitle;
-                                                       }
-                                               }
+                                                       dbesc($it['parent-uri']));
+
+                                               if(count($r) AND ($r[0]['title'] != ''))
+                                                       $subject = $r[0]['title'];
                                        }
+                                       if(strncasecmp($subject,'RE:',3))
+                                               $subject = 'Re: '.$subject;
                                }
-                               /*$headers .= 'MIME-Version: 1.0' . "\n";
-                               //$headers .= 'Content-Type: text/html; charset=UTF-8' . "\n";
-                               $headers .= 'Content-Type: text/plain; charset=UTF-8' . "\n";
-                               $headers .= 'Content-Transfer-Encoding: 8bit' . "\n\n";
-                               $html    = prepare_body($it);
-                               //$message = '<html><body>' . $html . '</body></html>';
-                               $message = html2plain($html);
-                               logger('notifier: email delivery to ' . $addr);
-                               mail($addr, $subject, $message, $headers);*/
                                email_send($addr, $subject, $headers, $it);
                        }
                        break;
index c0a98c8eb37c009b22b15cfcc3545e416715dfb2..07edc70465a07b7dfb3f828b62b8d7a54e01ec75 100755 (executable)
@@ -655,31 +655,16 @@ function notifier_run($argv, $argc){
 
                                                if($it['uri'] !== $it['parent-uri']) {
                                                        $headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n";
-                                                       if(! strlen($it['title'])) {
+                                                       if(!strlen($it['title'])) {
                                                                $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' LIMIT 1",
-                                                                       dbesc($it['parent-uri'])
-                                                               );
-                                                               if(count($r)) {
-                                                                       $subtitle = $r[0]['title'];
-                                                                       if($subtitle) {
-                                                                               if(strncasecmp($subtitle,'RE:',3))
-                                                                                       $subject = $subtitle;
-                                                                               else
-                                                                                       $subject = 'Re: ' . $subtitle;
-                                                                       }
-                                                               }
+                                                                       dbesc($it['parent-uri']));
+
+                                                               if(count($r) AND ($r[0]['title'] != ''))  
+                                                                       $subject = $r[0]['title'];
                                                        }
+                                                       if(strncasecmp($subject,'RE:',3))
+                                                               $subject = 'Re: '.$subject;
                                                }
-
-                                               /*$headers .= 'MIME-Version: 1.0' . "\n";
-                                               //$headers .= 'Content-Type: text/html; charset=UTF-8' . "\n";
-                                               $headers .= 'Content-Type: text/plain; charset=UTF-8' . "\n";
-                                               $headers .= 'Content-Transfer-Encoding: 8bit' . "\n\n";
-                                               $html    = prepare_body($it);
-                                               //$message = '<html><body>' . $html . '</body></html>';
-                                               $message = html2plain($html);
-                                               logger('notifier: email delivery to ' . $addr);
-                                               mail($addr, $subject, $message, $headers);*/
                                                email_send($addr, $subject, $headers, $it);
                                        }
                                        break;