basic support (still needs some js to expose it) for sharing an item on a remote site by sending it through oexchange on your home hub. Untested.

This commit is contained in:
friendica
2013-10-23 21:49:50 -07:00
parent 7b7ef56b54
commit c88fd01205
2 changed files with 54 additions and 14 deletions
+15
View File
@@ -15,6 +15,21 @@ function oexchange_init(&$a) {
function oexchange_content(&$a) {
if(! local_user()) {
if(remote_user()) {
$observer = $a->get_observer();
if($observer && $observer['xchan_url']) {
$parsed = @parse_url($observer['xchan_url']);
if(! $parsed) {
notice( t('Unable to find your hub.') . EOL);
return;
}
$url = $parsed['scheme'] . '://' . $parsed['host'] . (($parsed['port']) ? ':' . $parsed['port'] : '');
$url .= '/oexchange';
$result = z_post_url($url,$_REQUEST);
json_return_and_die($result);
}
}
return login(false);
}