aboutsummaryrefslogtreecommitdiffstats
path: root/include/feedutils.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-07-17 22:17:40 -0700
committerzotlabs <mike@macgirvin.com>2017-07-17 22:17:40 -0700
commitd8c93c0d13133d336e2cc3dbf3c48e0a6350c2d6 (patch)
tree046c636a6bdc05d9c5a2f2571476731b47fba373 /include/feedutils.php
parent42abc2201c8e7c3798ddfe2fd32300d211035364 (diff)
downloadvolse-hubzilla-d8c93c0d13133d336e2cc3dbf3c48e0a6350c2d6.tar.gz
volse-hubzilla-d8c93c0d13133d336e2cc3dbf3c48e0a6350c2d6.tar.bz2
volse-hubzilla-d8c93c0d13133d336e2cc3dbf3c48e0a6350c2d6.zip
activitypub, cont.
Diffstat (limited to 'include/feedutils.php')
-rw-r--r--include/feedutils.php40
1 files changed, 26 insertions, 14 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index 5f2a06029..b31448d81 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -1937,22 +1937,34 @@ function asencode_note($i) {
function asencode_person($p) {
- $ret = array();
- $ret['type'] = 'Person';
- $ret['id'] = $p['xchan_url'];
- $ret['name'] = $p['xchan_name'];
- $ret['image'] = array(
- 'type' => 'Link',
+ $ret = [];
+ $ret['type'] = 'Person';
+ $ret['id'] = $p['xchan_url'];
+ $ret['name'] = $p['xchan_name'];
+ $ret['icon'] = [ $p['xchan_photo_l'] ];
+ $ret['image'] = [
+ 'type' => 'Link',
'mediaType' => $p['xchan_photo_mimetype'],
- 'href' => $p['xchan_photo_l'],
- 'height' => 300,
- 'width' => 300
- );
- $ret['url'] = array(
- 'type' => 'Link',
+ 'href' => $p['xchan_photo_l'],
+ 'height' => 300,
+ 'width' => 300
+ ];
+ $ret['url'] = [
+ 'type' => 'Link',
'mediaType' => 'text/html',
- 'href' => $p['xchan_url']
- );
+ 'href' => $p['xchan_url']
+ ];
+
+ if(array_key_exists('channel_id',$p)) {
+ $ret['inbox'] = z_root() . '/inbox/' . $p['channel_address'];
+ $ret['outbox'] = z_root() . '/outbox/' . $p['channel_address'];
+ }
+ else {
+ $collections = get_xconfig($p['xchan_hash'],'activitystreams','collections',[]);
+ if($collections) {
+ $ret = array_merge($ret,$collections);
+ }
+ }
return $ret;
}