]> git.mxchange.org Git - friendica.git/blobdiff - include/delivery.php
Merge branch 'pull'
[friendica.git] / include / delivery.php
index 4b85a9ad1f6ae95f804930ba3583bfc2b85fe7d0..5d81228ee47a9c26ba91beba1c92a101ca780b61 100644 (file)
@@ -37,6 +37,19 @@ function delivery_run($argv, $argc){
        $item_id    = intval($argv[2]);
        $contact_id = intval($argv[3]);
 
+       // 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(! count($r)) {
+               return;
+       }       
+
+       // It's ours to deliver. Remove it from the queue.
+
        q("delete from deliverq where cmd = '%s' and item = %d and contact = %d limit 1",
                dbesc($cmd),
                dbesc($item_id),