From c88fd0120542a56da98cda6427d9bf5b689e21f2 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 23 Oct 2013 21:49:50 -0700 Subject: 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. --- mod/oexchange.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mod/oexchange.php') 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); } -- cgit v1.2.3