diff options
author | Mario <mario@mariovavti.com> | 2024-02-29 17:05:48 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-02-29 17:05:48 +0000 |
commit | 46f67eaa1e40954267088ba67726adc0d389628c (patch) | |
tree | 245878793f90aeb8f7a1c3ac586606166e853761 /Zotlabs/Lib | |
parent | 291e12574aeb3b71200b23d8ffc630a36f170008 (diff) | |
download | volse-hubzilla-46f67eaa1e40954267088ba67726adc0d389628c.tar.gz volse-hubzilla-46f67eaa1e40954267088ba67726adc0d389628c.tar.bz2 volse-hubzilla-46f67eaa1e40954267088ba67726adc0d389628c.zip |
AS2 Update and implement a first draft of AS2 Profile activities
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 27 | ||||
-rw-r--r-- | Zotlabs/Lib/Libzot.php | 1 |
2 files changed, 21 insertions, 7 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index b4ce4b5d0..eef4f8036 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -172,10 +172,6 @@ class Activity { } static function fetch_person($x) { - return self::fetch_profile($x); - } - - static function fetch_profile($x) { $r = q("select * from xchan where xchan_url = '%s' limit 1", dbesc($x['id']) ); @@ -189,7 +185,14 @@ class Activity { return []; return self::encode_person($r[0]); + } + + static function fetch_profile($x) { + if (isset($x['describes'])) { + return $x; + } + return []; } static function fetch_thing($x) { @@ -978,6 +981,7 @@ class Activity { $ret['to'] = [ACTIVITY_PUBLIC_INBOX]; } + $hookinfo = [ 'item' => $i, 'encoded' => $ret @@ -2049,6 +2053,10 @@ class Activity { $s['mid'] = $act->obj['data']['id']; } + if ($act->objprop('type') === 'Profile') { + $s['mid'] = $act->id; + } + if (!$s['mid']) { return false; } @@ -2293,6 +2301,14 @@ class Activity { if (!$response_activity) { + if ($act->objprop('type') === 'Profile') { + $s['parent_mid'] = $s['mid']; + $s['item_thread_top'] = 1; + $s['summary'] = ''; + $s['body'] = self::bb_content($content, 'summary'); + } + + // we will need a hook here to extract magnet links e.g. peertube // right now just link to the largest mp4 we find that will fit in our // standard content region @@ -2438,7 +2454,6 @@ class Activity { } } - if ($act->objprop('type') === 'Page' && !$s['body']) { $ptr = null; @@ -2479,7 +2494,7 @@ class Activity { } } - if (in_array($act->objprop('type', ''), ['Note', 'Article', 'Page'])) { + if (in_array($act->objprop('type'), ['Note', 'Article', 'Page'])) { $ptr = null; if (array_key_exists('url', $act->obj)) { diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index a98ae8f20..942c3082a 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1143,7 +1143,6 @@ class Libzot { if ($env['encoding'] === 'activitystreams') { $AS = new ActivityStreams($data); - if (!$AS->is_valid()) { logger('Activity rejected: ' . print_r($data, true)); return; |