diff options
author | redmatrix <git@macgirvin.com> | 2016-03-14 22:14:17 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-03-14 22:14:17 -0700 |
commit | b673b6835d50a906e44b34ed7195ea28156b7fb0 (patch) | |
tree | 1d93b192b59cd8160fce89ae929e4e5b22b6f954 /include/items.php | |
parent | ef7494359ff78596f42ae034a0f04529b9d5afe5 (diff) | |
download | volse-hubzilla-b673b6835d50a906e44b34ed7195ea28156b7fb0.tar.gz volse-hubzilla-b673b6835d50a906e44b34ed7195ea28156b7fb0.tar.bz2 volse-hubzilla-b673b6835d50a906e44b34ed7195ea28156b7fb0.zip |
federation work
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/include/items.php b/include/items.php index 9163016e1..d12989707 100755 --- a/include/items.php +++ b/include/items.php @@ -2091,6 +2091,10 @@ function get_atom_elements($feed, $item, &$author) { $res['obj_type'] = $child[NAMESPACE_ACTIVITY]['obj_type'][0]['data']; $obj['type'] = $child[NAMESPACE_ACTIVITY]['obj_type'][0]['data']; } + if($child[NAMESPACE_ACTIVITY]['object-type'][0]['data']) { + $res['obj_type'] = $child[NAMESPACE_ACTIVITY]['object-type'][0]['data']; + $obj['type'] = $child[NAMESPACE_ACTIVITY]['object-type'][0]['data']; + } if(x($child[SIMPLEPIE_NAMESPACE_ATOM_10], 'id') && $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data']) $obj['id'] = $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data']; if(x($child[SIMPLEPIE_NAMESPACE_ATOM_10], 'link') && $child[SIMPLEPIE_NAMESPACE_ATOM_10]['link']) @@ -2124,6 +2128,10 @@ function get_atom_elements($feed, $item, &$author) { $res['tgt_type'] = $child[NAMESPACE_ACTIVITY]['obj_type'][0]['data']; $obj['type'] = $child[NAMESPACE_ACTIVITY]['obj_type'][0]['data']; } + if($child[NAMESPACE_ACTIVITY]['object-type'][0]['data']) { + $res['tgt_type'] = $child[NAMESPACE_ACTIVITY]['object-type'][0]['data']; + $obj['type'] = $child[NAMESPACE_ACTIVITY]['object-type'][0]['data']; + } if(x($child[SIMPLEPIE_NAMESPACE_ATOM_10], 'id') && $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data']) $obj['id'] = $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data']; if(x($child[SIMPLEPIE_NAMESPACE_ATOM_10], 'link') && $child[SIMPLEPIE_NAMESPACE_ATOM_10]['link']) @@ -2162,26 +2170,27 @@ function get_atom_elements($feed, $item, &$author) { } function encode_rel_links($links) { - $o = ''; + $o = array(); if(! ((is_array($links)) && (count($links)))) return $o; foreach($links as $link) { - $o .= '<link '; + $l = array(); if($link['attribs']['']['rel']) - $o .= 'rel="' . $link['attribs']['']['rel'] . '" '; + $l['rel'] = $link['attribs']['']['rel']; if($link['attribs']['']['type']) - $o .= 'type="' . $link['attribs']['']['type'] . '" '; + $l['type'] = $link['attribs']['']['type']; if($link['attribs']['']['href']) - $o .= 'href="' . $link['attribs']['']['href'] . '" '; + $l['href'] = $link['attribs']['']['href']; if( (x($link['attribs'],NAMESPACE_MEDIA)) && $link['attribs'][NAMESPACE_MEDIA]['width']) - $o .= 'media:width="' . $link['attribs'][NAMESPACE_MEDIA]['width'] . '" '; + $l['width'] = $link['attribs'][NAMESPACE_MEDIA]['width']; if( (x($link['attribs'],NAMESPACE_MEDIA)) && $link['attribs'][NAMESPACE_MEDIA]['height']) - $o .= 'media:height="' . $link['attribs'][NAMESPACE_MEDIA]['height'] . '" '; - $o .= ' />' . "\n" ; - } + $l['height'] = $link['attribs'][NAMESPACE_MEDIA]['height']; - return xmlify($o); + if($l) + $o[] = $l; + } + return $o; } /** @@ -4039,6 +4048,11 @@ function process_salmon_feed($xml, $importer) { $datarray = get_atom_elements($feed,$item,$ret['author']); + // reset policies which are restricted by default for RSS connections + // This item is likely coming from GNU-social via salmon and allows public interaction + $datarray['public_policy'] = ''; + $datarray['comment_policy'] = ''; + $ret['item'] = $datarray; } } |