From c74068ae4d1b5af9dcaf9fac04cdabdcc5729b33 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 7 Nov 2023 08:33:22 +0000 Subject: libzot: correctly attribute streams repeats --- Zotlabs/Lib/Libzot.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'Zotlabs/Lib/Libzot.php') diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index fba9f118e..13cc8b1ae 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1114,6 +1114,7 @@ class Libzot { */ static function import($arr) { + $env = $arr; $private = false; $return = []; @@ -1219,13 +1220,20 @@ class Libzot { return; } - $r = Activity::get_actor_hublocs($AS->actor['id']); + $author_url = $AS->actor['id']; + + if ($AS->type === 'Announce') { + hz_syslog(print_r($AS, true)); + $author_url = Activity::get_attributed_to_actor_url($AS); + } + + $r = Activity::get_actor_hublocs($author_url); - if (! $r) { + if (!$r) { // Author is unknown to this site. Perform channel discovery and try again. - $z = discover_by_webbie($AS->actor['id']); + $z = discover_by_webbie($author_url); if ($z) { - $r = Activity::get_actor_hublocs($AS->actor['id']); + $r = Activity::get_actor_hublocs($author_url); } } @@ -1829,6 +1837,11 @@ class Libzot { if ($r) { // We already have this post. + // Dismiss its announce + if ($act->type === 'Announce') { + return; + } + $item_id = $r[0]['id']; if (intval($r[0]['item_deleted'])) { -- cgit v1.2.3