aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
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']);