filter out duplicate recipients on local deliveries. We only need to deliver stuff once to any particular channel.

This commit is contained in:
friendica 2013-11-17 20:43:50 -08:00
parent 6378600747
commit f8b07e1935

View File

@ -910,6 +910,24 @@ function zot_import($arr, $sender_url) {
$deliveries = allowed_public_recips($i); $deliveries = allowed_public_recips($i);
} }
// Go through the hash array and remove duplicates. array_unique() won't do this because the array is more than one level.
$no_dups = array();
if($deliveries) {
foreach($deliveries as $d) {
if(! in_array($d['hash'],$no_dups))
$no_dups[] = $d['hash'];
}
if($no_dups) {
$deliveries = array();
foreach($no_dups as $n) {
$deliveries[] = array('hash' => $n);
}
}
}
if(! $deliveries) { if(! $deliveries) {
logger('zot_import: no deliveries on this site'); logger('zot_import: no deliveries on this site');
continue; continue;