From 6421a32520588af4506f108036bb8ccaa9621465 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 30 Aug 2022 13:51:59 +0000 Subject: fix issue where an unkown diaspora author was not imported if the comment arrived via a relayed activity and a minor css fix --- Zotlabs/Lib/ActivityStreams.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Lib/ActivityStreams.php') diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index e77b501b3..c0b07bfb5 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -308,20 +308,25 @@ class ActivityStreams { function get_actor($property, $base = '', $namespace = '') { $x = $this->get_property_obj($property, $base, $namespace); + if ($this->is_url($x)) { $y = Activity::get_cached_actor($x); if ($y) { return $y; } } + $actor = $this->get_compound_property($property, $base, $namespace, true); + if (is_array($actor) && self::is_an_actor($actor['type'])) { if (array_key_exists('id', $actor) && (!array_key_exists('inbox', $actor))) { $actor = $this->fetch_property($actor['id']); } return $actor; } - return null; + + return Activity::get_unknown_actor($this->data); + } -- cgit v1.2.3 From 480862d7143f291658b48e785eda2e61a438a74b Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 11 Sep 2022 14:58:40 +0000 Subject: php8: fix more warnings --- Zotlabs/Lib/ActivityStreams.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Zotlabs/Lib/ActivityStreams.php') diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index c0b07bfb5..fc580e9aa 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -116,17 +116,17 @@ class ActivityStreams { $this->obj['object'] = $this->get_compound_property($this->obj['object']); } - if ($this->obj && is_array($this->obj) && $this->obj['actor']) + if ($this->obj && is_array($this->obj) && isset($this->obj['actor'])) $this->obj['actor'] = $this->get_actor('actor', $this->obj); - if ($this->tgt && is_array($this->tgt) && $this->tgt['actor']) + if ($this->tgt && is_array($this->tgt) && isset($this->tgt['actor'])) $this->tgt['actor'] = $this->get_actor('actor', $this->tgt); $this->parent_id = $this->get_property_obj('inReplyTo'); - if ((!$this->parent_id) && is_array($this->obj)) { + if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['inReplyTo'])) { $this->parent_id = $this->obj['inReplyTo']; } - if ((!$this->parent_id) && is_array($this->obj)) { + if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['id'])) { $this->parent_id = $this->obj['id']; } } -- cgit v1.2.3 From 96535ee4df967f04d4cc6c3b7f9ab335a50f543d Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 13 Sep 2022 11:20:35 +0000 Subject: make actor_store() fetch the actor object if none is provided, remove announce from the is_response array and provide a function to find the attributedTo url --- Zotlabs/Lib/ActivityStreams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Lib/ActivityStreams.php') diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index fc580e9aa..a07fdacb7 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -294,7 +294,7 @@ class ActivityStreams { if (!$s) { return false; } - return (in_array($s, ['Like', 'Dislike', 'Flag', 'Block', 'Announce', 'Accept', 'Reject', 'TentativeAccept', 'TentativeReject', 'emojiReaction', 'EmojiReaction', 'EmojiReact'])); + return (in_array($s, ['Like', 'Dislike', 'Flag', 'Block', 'Accept', 'Reject', 'TentativeAccept', 'TentativeReject', 'emojiReaction', 'EmojiReaction', 'EmojiReact'])); } /** -- cgit v1.2.3