aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-26 23:39:47 -0700
committerFriendika <info@friendika.com>2011-09-26 23:39:47 -0700
commite04d9b864606827f1ab85c6dff94d1e3d8b48908 (patch)
tree147ff97c6601c0a0c82c64094504b54865d3ccf8
parentec16525c860c089c354dc22acc30996ca8bf572f (diff)
downloadvolse-hubzilla-e04d9b864606827f1ab85c6dff94d1e3d8b48908.tar.gz
volse-hubzilla-e04d9b864606827f1ab85c6dff94d1e3d8b48908.tar.bz2
volse-hubzilla-e04d9b864606827f1ab85c6dff94d1e3d8b48908.zip
bug #165
-rw-r--r--boot.php2
-rw-r--r--include/delivery.php16
2 files changed, 13 insertions, 5 deletions
diff --git a/boot.php b/boot.php
index 3ad9cb455..48d52846e 100644
--- a/boot.php
+++ b/boot.php
@@ -7,7 +7,7 @@ require_once('include/text.php');
require_once("include/pgettext.php");
-define ( 'FRIENDIKA_VERSION', '2.3.1115' );
+define ( 'FRIENDIKA_VERSION', '2.3.1116' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1092 );
diff --git a/include/delivery.php b/include/delivery.php
index 706c07b3b..06cc1f679 100644
--- a/include/delivery.php
+++ b/include/delivery.php
@@ -107,10 +107,18 @@ function delivery_run($argv, $argc){
return;
}
- $icontacts = q("SELECT * FROM `contact` WHERE `id` IN ( SELECT distinct(`contact-id`) FROM `item` where `parent` = %d ) ",
- intval($parent_id)
- );
- if(! count($icontacts))
+ $icontacts = null;
+ $contacts_arr = array();
+ foreach($items as $item)
+ if(! in_array($item['contact-id'],$contacts_arr))
+ $contacts_arr[] = intval($item['contact-id']);
+ if(count($contacts_arr)) {
+ $str_contacts = implode(',',$contacts_arr);
+ $icontacts = q("SELECT * FROM `contact`
+ WHERE `id` IN ( $str_contacts ) "
+ );
+ }
+ if( ! ($icontacts && count($icontacts)))
return;