]> git.mxchange.org Git - friendica.git/blobdiff - include/delivery.php
Central item expiration routine for external items
[friendica.git] / include / delivery.php
index c48e606f488264672e3759a9c54c419b434b4ada..098e423d170d9d6efb8dd7e3903fb6e6cc307e36 100644 (file)
@@ -1,21 +1,22 @@
 <?php
 
-use \Friendica\Core\Config;
+use Friendica\App;
+use Friendica\Core\Config;
 
-require_once('include/queue_fn.php');
-require_once('include/html2plain.php');
-require_once('include/Scrape.php');
-require_once('include/diaspora.php');
-require_once('include/ostatus.php');
-require_once('include/dfrn.php');
+require_once 'include/queue_fn.php';
+require_once 'include/html2plain.php';
+require_once 'include/probe.php';
+require_once 'include/diaspora.php';
+require_once 'include/ostatus.php';
+require_once 'include/dfrn.php';
 
 function delivery_run(&$argv, &$argc){
        global $a;
 
-       require_once('include/datetime.php');
-       require_once('include/items.php');
-       require_once('include/bbcode.php');
-       require_once('include/email.php');
+       require_once 'include/datetime.php';
+       require_once 'include/items.php';
+       require_once 'include/bbcode.php';
+       require_once 'include/email.php';
 
        if ($argc < 3) {
                return;
@@ -30,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;
                }
@@ -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];