aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-17 20:43:50 -0800
committerfriendica <info@friendica.com>2013-11-17 20:43:50 -0800
commitf8b07e1935dd6d035b7458141eca099a2445b077 (patch)
treecace5f5777a3679b9112199efca042c5e7c82d17 /include/zot.php
parent6378600747e70ed19f43614cd022aa332d731c45 (diff)
downloadvolse-hubzilla-f8b07e1935dd6d035b7458141eca099a2445b077.tar.gz
volse-hubzilla-f8b07e1935dd6d035b7458141eca099a2445b077.tar.bz2
volse-hubzilla-f8b07e1935dd6d035b7458141eca099a2445b077.zip
filter out duplicate recipients on local deliveries. We only need to deliver stuff once to any particular channel.
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/zot.php b/include/zot.php
index 018f00ba5..1191cc221 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -910,11 +910,29 @@ function zot_import($arr, $sender_url) {
$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) {
logger('zot_import: no deliveries on this site');
continue;
}
-
+
if($i['message']) {
if($i['message']['type'] === 'activity') {
$arr = get_item_elements($i['message']);