aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Libzot.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Lib/Libzot.php')
-rw-r--r--Zotlabs/Lib/Libzot.php21
1 files changed, 17 insertions, 4 deletions
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'])) {