aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-03-14 22:14:17 -0700
committerredmatrix <git@macgirvin.com>2016-03-14 22:14:17 -0700
commitb673b6835d50a906e44b34ed7195ea28156b7fb0 (patch)
tree1d93b192b59cd8160fce89ae929e4e5b22b6f954
parentef7494359ff78596f42ae034a0f04529b9d5afe5 (diff)
downloadvolse-hubzilla-b673b6835d50a906e44b34ed7195ea28156b7fb0.tar.gz
volse-hubzilla-b673b6835d50a906e44b34ed7195ea28156b7fb0.tar.bz2
volse-hubzilla-b673b6835d50a906e44b34ed7195ea28156b7fb0.zip
federation work
-rwxr-xr-xinclude/items.php34
-rw-r--r--include/network.php1
2 files changed, 25 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;
}
}
diff --git a/include/network.php b/include/network.php
index 4eca53f92..7399b4526 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1304,6 +1304,7 @@ function webfinger_rfc7033($webbie,$zot = false) {
else
return false;
}
+ logger('fetching url from resource: ' . $rhs . ':' . $webbie);
$s = z_fetch_url('https://' . $rhs . '/.well-known/webfinger?f=&resource=' . $resource . (($zot) ? '&zot=1' : ''));