aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-02-14 20:23:02 +0000
committerMario <mario@mariovavti.com>2024-02-14 20:23:02 +0000
commit9859008271d1493ad600dff34a1d6e250378c496 (patch)
tree47c7f50bf390cb93c819dcce638a2dd60b6ef928
parent423c36f67b3809e58396ebea3ccbf9c15b7ab3c9 (diff)
downloadvolse-hubzilla-9859008271d1493ad600dff34a1d6e250378c496.tar.gz
volse-hubzilla-9859008271d1493ad600dff34a1d6e250378c496.tar.bz2
volse-hubzilla-9859008271d1493ad600dff34a1d6e250378c496.zip
deal with inReplyTo array + some docu and style
-rw-r--r--Zotlabs/Lib/ActivityStreams.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index b3b58af89..9f028bb46 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -89,7 +89,7 @@ class ActivityStreams {
// Attempt to assemble an Activity from what we were given.
if ($this->is_valid()) {
- $this->id = $this->get_property_obj('id');
+ $this->id = $this->get_property_obj('id');
if (!$this->id) {
logger('Data with mmissing id: ' . print_r($this->data, true));
@@ -130,24 +130,31 @@ class ActivityStreams {
}
}
- // fetch recursive or embedded activities
+ // Fetch recursive or embedded activities
if ($this->obj && is_array($this->obj) && array_key_exists('object', $this->obj)) {
$this->obj['object'] = $this->get_compound_property('object', $this->obj);
}
- if ($this->obj && is_array($this->obj) && isset($this->obj['actor']))
+ // Enumerate and store actors in referenced objects
+
+ 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) && isset($this->tgt['actor']))
+ }
+
+ if ($this->tgt && is_array($this->tgt) && isset($this->tgt['actor'])) {
$this->tgt['actor'] = $this->get_actor('actor', $this->tgt);
+ }
+
+ // Determine if this is a followup or response activity
$this->parent_id = $this->get_property_obj('inReplyTo');
- if (!$this->parent_id && is_array($this->obj) && isset($this->obj['inReplyTo'])) {
- $this->parent_id = $this->obj['inReplyTo'];
+ if (!$this->parent_id && isset($this->obj['inReplyTo'])) {
+ $this->parent_id = ((is_array($this->obj['inReplyTo'])) ? $this->obj['inReplyTo']['id'] : $this->obj['inReplyTo']);
}
- if (!$this->parent_id && is_array($this->obj) && isset($this->obj['id'])) {
+ if (!$this->parent_id && isset($this->obj['id'])) {
$this->parent_id = $this->obj['id'];
}