aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/ActivityStreams.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-01-28 14:57:37 +0000
committerMario <mario@mariovavti.com>2021-01-28 14:57:37 +0000
commit8c2442eca5889a5ece659bdb456403b28285b26b (patch)
tree83f0ca36be46f2aa775880572a24f1a62110217f /Zotlabs/Lib/ActivityStreams.php
parent8b78e18fb8ade1d04dbf2e5152288f6982a462df (diff)
downloadvolse-hubzilla-8c2442eca5889a5ece659bdb456403b28285b26b.tar.gz
volse-hubzilla-8c2442eca5889a5ece659bdb456403b28285b26b.tar.bz2
volse-hubzilla-8c2442eca5889a5ece659bdb456403b28285b26b.zip
AS channel discovery with custom access header
Diffstat (limited to 'Zotlabs/Lib/ActivityStreams.php')
-rw-r--r--Zotlabs/Lib/ActivityStreams.php29
1 files changed, 23 insertions, 6 deletions
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index f877fbb45..a1d780205 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -409,16 +409,33 @@ class ActivityStreams {
return $x;
}
- static function is_as_request() {
+ static function is_as_request($channel = null) {
- $x = getBestSupportedMimeType([
- 'application/ld+json;profile="https://www.w3.org/ns/activitystreams"',
- 'application/activity+json',
- 'application/ld+json;profile="http://www.w3.org/ns/activitystreams"'
- ]);
+ $hookdata = [];
+ if($channel)
+ $hookdata['channel'] = $channel;
+ $hookdata['data'] = ['application/x-zot-activity+json'];
+
+ call_hooks('is_as_request', $hookdata);
+
+ $x = getBestSupportedMimeType($hookdata['data']);
return(($x) ? true : false);
}
+ static function get_accept_header_string($channel = null) {
+
+ $hookdata = [];
+ if($channel)
+ $hookdata['channel'] = $channel;
+
+ $hookdata['data'] = 'application/x-zot-activity+json';
+
+ call_hooks('get_accept_header_string', $hookdata);
+
+ return $hookdata['data'];
+
+ }
+
}