diff options
author | friendica <info@friendica.com> | 2012-03-15 15:30:52 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-03-15 15:30:52 -0700 |
commit | 5d2c590fa93764c19043981e8398d97c6bae902b (patch) | |
tree | 5f8ac29b83606f9405430a7605dd42b8d66bef43 /include/delivery.php | |
parent | 5c75d40c0b6bee04d8c58a6f88ecbbe34684874a (diff) | |
parent | b5120888cf6e3aac29aa2a8d80bddcab73822e1e (diff) | |
download | volse-hubzilla-5d2c590fa93764c19043981e8398d97c6bae902b.tar.gz volse-hubzilla-5d2c590fa93764c19043981e8398d97c6bae902b.tar.bz2 volse-hubzilla-5d2c590fa93764c19043981e8398d97c6bae902b.zip |
Merge pull request #136 from annando/master
Mail improvements, item caching and so on
Diffstat (limited to 'include/delivery.php')
-rwxr-xr-x | include/delivery.php | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/include/delivery.php b/include/delivery.php index c1ff07bd5..44a482ca2 100755 --- a/include/delivery.php +++ b/include/delivery.php @@ -435,8 +435,8 @@ function delivery_run($argv, $argc){ $headers .= 'Reply-to: ' . $reply_to . "\n"; // for testing purposes: Collect exported mails - $file = tempnam("/tmp/friendica/", "mail-out-"); - file_put_contents($file, json_encode($it)); + // $file = tempnam("/tmp/friendica/", "mail-out-"); + // file_put_contents($file, json_encode($it)); $headers .= 'Message-Id: <' . iri2msgid($it['uri']). '>' . "\n"; @@ -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; |