X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fpoller.php;h=085e95a6ae1842c421e9c7eb6d341dbde72a1578;hb=3393d80ac1af69eaa735a28284e23153735dde55;hp=f165ad590520003e037f32d13e28a0d416b1cc9b;hpb=e098147c24bd45bc15c14fc597bd101b66011458;p=friendica.git diff --git a/include/poller.php b/include/poller.php index f165ad5905..085e95a6ae 100755 --- a/include/poller.php +++ b/include/poller.php @@ -69,6 +69,19 @@ function poller_run($argv, $argc){ // clear old cache Cache::clear(); + // clear item cache files if they are older than one day + $cache = get_config('system','itemcache'); + if (($cache != '') and is_dir($cache)) { + if ($dh = opendir($cache)) { + while (($file = readdir($dh)) !== false) { + $fullpath = $cache."/".$file; + if ((filetype($fullpath) == "file") and filectime($fullpath) < (time() - 86400)) + unlink($fullpath); + } + closedir($dh); + } + } + $manual_id = 0; $generation = 0; $hub_update = false; @@ -491,7 +504,12 @@ function poller_run($argv, $argc){ //$datarray['title'] = notags(trim($meta->subject)); $datarray['created'] = datetime_convert('UTC','UTC',$meta->date); - $r = email_get_msg($mbox,$msg_uid); + // Is it reply? + $reply = ((substr(strtolower($datarray['title']), 0, 3) == "re:") or + (substr(strtolower($datarray['title']), 0, 3) == "re-") or + (raw_refs != "")); + + $r = email_get_msg($mbox,$msg_uid, $reply); if(! $r) { logger("Mail: can't fetch msg ".$msg_uid); continue;