X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fpoller.php;h=7490bfa819adcc561dd8f80b3962a263576fef9a;hb=19ccd658ebcf13a7cc208a3e460e44d152dda32f;hp=b5639e03472f759a81ab1b2831328bb537457388;hpb=a0179235d2d4672ba9dc79b33505555766b3228a;p=friendica.git diff --git a/include/poller.php b/include/poller.php index b5639e0347..7490bfa819 100644 --- a/include/poller.php +++ b/include/poller.php @@ -26,6 +26,8 @@ function poller_run($argv, $argc){ $a->set_baseurl(get_config('system','url')); + load_hooks(); + logger('poller: start'); // run queue delivery process in the background @@ -61,10 +63,12 @@ function poller_run($argv, $argc){ $sql_extra = (($manual_id) ? " AND `id` = $manual_id " : ""); + reload_plugins(); + $d = datetime_convert(); + call_hooks('cron', $d); - reload_plugins(); $contacts = q("SELECT `id` FROM `contact` WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != '' @@ -354,7 +358,7 @@ function poller_run($argv, $argc){ if(count($r)) { if($meta->deleted && ! $r[0]['deleted']) { - q("UPDATE `item` SET `deleted` = `, `changed` = '%s' WHERE `id` = %d LIMIT 1", + q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1", dbesc(datetime_convert()), intval($r[0]['id']) ); @@ -368,6 +372,13 @@ function poller_run($argv, $argc){ if(! $r) continue; $datarray['body'] = escape_tags($r['body']); + + // some mailing lists have the original author as 'from' - add this sender info to msg body. + // todo: adding a gravatar for the original author would be cool + + if(! stristr($meta->from,$contact['addr'])) + $datarray['body'] = t('From: ') . escape_tags($meta->from) . "\n\n" . $datarray['body']; + $datarray['uid'] = $importer_uid; $datarray['contact-id'] = $contact['id']; if($datarray['parent-uri'] === $datarray['uri'])