diff options
author | friendica <info@friendica.com> | 2013-10-23 21:49:50 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-10-23 21:49:50 -0700 |
commit | c88fd0120542a56da98cda6427d9bf5b689e21f2 (patch) | |
tree | 7c1da157d5b8491d8a7b57bb217596a440e5ad66 /mod/oexchange.php | |
parent | 7b7ef56b54a98f3d860b9b0c7dc4a7ce0657fede (diff) | |
download | volse-hubzilla-c88fd0120542a56da98cda6427d9bf5b689e21f2.tar.gz volse-hubzilla-c88fd0120542a56da98cda6427d9bf5b689e21f2.tar.bz2 volse-hubzilla-c88fd0120542a56da98cda6427d9bf5b689e21f2.zip |
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.
Diffstat (limited to 'mod/oexchange.php')
-rw-r--r-- | mod/oexchange.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mod/oexchange.php b/mod/oexchange.php index 63b48751c..27c8b388d 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -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); } |