X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdelivery.php;h=098e423d170d9d6efb8dd7e3903fb6e6cc307e36;hb=44efdc3e1b01328a226c79e25834fe7adb2dbaf4;hp=dd7535592f5e1fd46942f778b5d017ff86f4534e;hpb=dbf7c7d9ad697f7951f102c8372e7d65c167de96;p=friendica.git diff --git a/include/delivery.php b/include/delivery.php index dd7535592f..098e423d17 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -1,43 +1,27 @@ set_baseurl(get_config('system','url')); - logger('delivery: invoked: '. print_r($argv,true), LOGGER_DEBUG); $cmd = $argv[1]; @@ -47,30 +31,6 @@ function delivery_run(&$argv, &$argc){ $contact_id = intval($argv[$x]); - /// @todo When switching completely to the worker we won't need this anymore - // Some other process may have delivered this item already. - - $r = q("SELECT * FROM `deliverq` WHERE `cmd` = '%s' AND `item` = %d AND `contact` = %d LIMIT 1", - dbesc($cmd), - dbesc($item_id), - dbesc($contact_id) - ); - if (!dbm::is_result($r)) { - continue; - } - - if ($a->maxload_reached()) { - return; - } - - // It's ours to deliver. Remove it from the queue. - - q("DELETE FROM `deliverq` WHERE `cmd` = '%s' AND `item` = %d AND `contact` = %d", - dbesc($cmd), - dbesc($item_id), - dbesc($contact_id) - ); - if (!$item_id || !$contact_id) { continue; } @@ -206,7 +166,7 @@ function delivery_run(&$argv, &$argc){ $public_message = true; if (!($mail || $fsuggest || $relocate)) { - require_once('include/group.php'); + require_once 'include/group.php'; $parent = $items[0]; @@ -396,7 +356,7 @@ function delivery_run(&$argv, &$argc){ logger('notifier: dfrn_delivery to '.$contact["url"].' with guid '.$target_item["guid"].' returns '.$deliver_status); - if ($deliver_status == (-1)) { + if ($deliver_status < 0) { logger('notifier: delivery failed: queuing message'); add_to_queue($contact['id'],NETWORK_DFRN,$atom); @@ -575,8 +535,3 @@ function delivery_run(&$argv, &$argc){ return; } - -if (array_search(__file__,get_included_files())===0){ - delivery_run($_SERVER["argv"],$_SERVER["argc"]); - killme(); -}