diff options
author | Mario <mario@mariovavti.com> | 2023-07-11 18:57:18 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-07-11 18:57:18 +0000 |
commit | 63fb8d03929189bfc8cbf53d23cb79984fe2c3cd (patch) | |
tree | b9f74bd8c7721dca7ece251fdbb9a7c4fe9b949a /Zotlabs/Lib/ActivityStreams.php | |
parent | 57796a2f962d045445cbf69237bb3d6786e4d0d4 (diff) | |
parent | 384de0925e502cfa8fe6ca287530ef5529fdff10 (diff) | |
download | volse-hubzilla-8.6.tar.gz volse-hubzilla-8.6.tar.bz2 volse-hubzilla-8.6.zip |
Merge branch '8.6RC'8.6
Diffstat (limited to 'Zotlabs/Lib/ActivityStreams.php')
-rw-r--r-- | Zotlabs/Lib/ActivityStreams.php | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index f07f99ac3..8b8c95ad8 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -14,6 +14,7 @@ class ActivityStreams { public $meta = null; public $valid = false; public $deleted = false; + public $portable_id = null; public $id = ''; public $parent_id = ''; public $type = ''; @@ -35,12 +36,13 @@ class ActivityStreams { * * @param string $string */ - function __construct($string) { + function __construct($string, $portable_id = null) { if(!$string) return; $this->raw = $string; + $this->portable_id = $portable_id; if (is_array($string)) { $this->data = $string; @@ -123,13 +125,14 @@ class ActivityStreams { $this->parent_id = $this->get_property_obj('inReplyTo'); - if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['inReplyTo'])) { + 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) && isset($this->obj['id'])) { + if (!$this->parent_id && is_array($this->obj) && isset($this->obj['id'])) { $this->parent_id = $this->obj['id']; } + } } @@ -302,12 +305,26 @@ class ActivityStreams { * @return NULL|mixed */ - function fetch_property($url) { - return self::fetch($url); - } + function fetch_property($url, $channel = null) { + $x = null; + + if (str_starts_with($url, z_root() . '/item/')) { + $x = Activity::fetch_local($url, $this->portable_id ?? ''); + logger('local: ' . print_r($x,true)); + } + + if (!$x) { + $x = Activity::fetch($url, $channel); + if ($x === null && strpos($url, '/channel/')) { + // look for other nomadic channels which might be alive + $zf = Zotfinger::exec($url, $channel); - static function fetch($url, $channel = null) { - return Activity::fetch($url, $channel); + $url = $zf['signature']['signer']; + $x = Activity::fetch($url, $channel); + } + } + + return $x; } static function is_an_actor($s) { |