X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fpoller.php;h=499483d007dea6ecaffde1d9c4d0fffb420e79e3;hb=9a8c69b024745bdabd8a83bc0e65951a82722127;hp=8262c1d605242b0cd7122fb3eec94d5e06e6c181;hpb=5189a56ef832e1c5c6976f87d77d218bf4a6c221;p=friendica.git diff --git a/include/poller.php b/include/poller.php old mode 100755 new mode 100644 index 8262c1d605..499483d007 --- a/include/poller.php +++ b/include/poller.php @@ -25,10 +25,20 @@ function poller_run($argv, $argc){ require_once('include/Contact.php'); require_once('include/email.php'); require_once('include/socgraph.php'); + require_once('include/pidfile.php'); load_config('config'); load_config('system'); + $lockpath = get_config('system','lockpath'); + if ($lockpath != '') { + $pidfile = new pidfile($lockpath, 'poller.lck'); + if($pidfile->is_already_running()) { + logger("poller: Already running"); + exit; + } + } + $a->set_baseurl(get_config('system','url')); load_hooks(); @@ -504,7 +514,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;