aboutsummaryrefslogtreecommitdiffstats
path: root/include/delivery.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-28 22:59:49 -0700
committerFriendika <info@friendika.com>2011-08-28 22:59:49 -0700
commitb61d535f81af4c2ec2bcabd4378f1a8bfa3cd446 (patch)
tree91d1838338fa074052f8a091640a58c3de5d58f7 /include/delivery.php
parent846c4cea7c0e3868a63a187ee9a504a031b2a7e4 (diff)
downloadvolse-hubzilla-b61d535f81af4c2ec2bcabd4378f1a8bfa3cd446.tar.gz
volse-hubzilla-b61d535f81af4c2ec2bcabd4378f1a8bfa3cd446.tar.bz2
volse-hubzilla-b61d535f81af4c2ec2bcabd4378f1a8bfa3cd446.zip
remove item from queue
Diffstat (limited to 'include/delivery.php')
-rw-r--r--include/delivery.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/delivery.php b/include/delivery.php
index 1f5883c26..e32a9346c 100644
--- a/include/delivery.php
+++ b/include/delivery.php
@@ -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),