X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdelivery.php;h=05fba7985cd9bc41a90c21185569b7faa034da3c;hb=0cd9db9cb7f4c96f597e37590a536eaae123238d;hp=45ca68cf37b42484e72965495fbbec4cb822fe4e;hpb=48209f0ecd1e61cabfbf1eb5454197974807e441;p=friendica.git diff --git a/include/delivery.php b/include/delivery.php index 45ca68cf37..05fba7985c 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -1,21 +1,22 @@ 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; } @@ -114,7 +91,7 @@ function delivery_run(&$argv, &$argc){ $uid = $item_id; } else { // find ancestors - $r = q("SELECT * FROM `item` WHERE `id` = %d and visible = 1 and moderated = 0 LIMIT 1", + $r = q("SELECT * FROM `item` WHERE `id` = %d AND visible = 1 AND moderated = 0 LIMIT 1", intval($item_id) ); @@ -128,7 +105,7 @@ function delivery_run(&$argv, &$argc){ $updated = $r[0]['edited']; $items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer` - FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d and visible = 1 and moderated = 0 ORDER BY `id` ASC", + FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d AND visible = 1 AND moderated = 0 ORDER BY `id` ASC", intval($parent_id) ); @@ -189,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]; @@ -362,7 +339,7 @@ function delivery_run(&$argv, &$argc){ // If we are setup as a soapbox we aren't accepting top level posts from this person - if (($x[0]['page-flags'] == PAGE_SOAPBOX) AND $top_level) { + if (($x[0]['page-flags'] == PAGE_SOAPBOX) && $top_level) { break; } logger('mod-delivery: local delivery'); @@ -379,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); @@ -476,7 +453,7 @@ function delivery_run(&$argv, &$argc){ $headers .= "References: <".iri2msgid($it["parent-uri"]).">"; // If Threading is enabled, write down the correct parent - if (($it["thr-parent"] != "") and ($it["thr-parent"] != $it["parent-uri"])) + if (($it["thr-parent"] != "") && ($it["thr-parent"] != $it["parent-uri"])) $headers .= " <".iri2msgid($it["thr-parent"]).">"; $headers .= "\n"; @@ -485,14 +462,14 @@ function delivery_run(&$argv, &$argc){ dbesc($it['parent-uri']), intval($uid)); - if (dbm::is_result($r) AND ($r[0]['title'] != '')) { + if (dbm::is_result($r) && ($r[0]['title'] != '')) { $subject = $r[0]['title']; } else { $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($it['parent-uri']), intval($uid)); - if (dbm::is_result($r) AND ($r[0]['title'] != '')) + if (dbm::is_result($r) && ($r[0]['title'] != '')) $subject = $r[0]['title']; } }