]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'pull'
authorFriendika <info@friendika.com>
Mon, 29 Aug 2011 06:01:42 +0000 (23:01 -0700)
committerFriendika <info@friendika.com>
Mon, 29 Aug 2011 06:01:42 +0000 (23:01 -0700)
1  2 
include/delivery.php

diff --combined include/delivery.php
index 4b85a9ad1f6ae95f804930ba3583bfc2b85fe7d0,e32a9346cdbaf0b4badc961fea3350ffb5a77209..5d81228ee47a9c26ba91beba1c92a101ca780b61
@@@ -37,6 -37,19 +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),
                                $item['deleted'] = 1;
                }
  
 -              if(count($items) == 1 && $items[0]['uri'] === $items[0]['parent-uri'])
 +              if((count($items) == 1) && ($items[0]['uri'] === $items[0]['parent-uri'])) {
 +                      logger('delivery: top level post');
                        $top_level = true;
 +              }
        }
  
        $r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,