From c2475f88539ba8053596acd17be39ad0aec98bb4 Mon Sep 17 00:00:00 2001 From: James Walker Date: Tue, 9 Feb 2010 15:37:37 -0500 Subject: in progress Salmon responses --- plugins/OStatus/actions/salmon.php | 49 +++++++++++++++++++++++++++++++++++ plugins/OStatus/actions/webfinger.php | 7 +++++ 2 files changed, 56 insertions(+) create mode 100644 plugins/OStatus/actions/salmon.php (limited to 'plugins/OStatus/actions') diff --git a/plugins/OStatus/actions/salmon.php b/plugins/OStatus/actions/salmon.php new file mode 100644 index 000000000..012869cf7 --- /dev/null +++ b/plugins/OStatus/actions/salmon.php @@ -0,0 +1,49 @@ +. + */ + +/** + * @package OStatusPlugin + * @author James Walker + */ + +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } + +class SalmonAction extends Action +{ + + function handle() + { + parent::handle(); + if ($_SERVER['REQUEST_METHOD'] == 'POST') { + $this->handlePost(); + } + } + + + function handlePost() + { + $user_id = $this->arg('id'); + common_log(LOG_DEBUG, 'Salmon: incoming post for user: '. $user_id); + + $xml = file_get_contents('php://input'); + + // TODO : Insert new $xml -> notice code + + } +} diff --git a/plugins/OStatus/actions/webfinger.php b/plugins/OStatus/actions/webfinger.php index ec2dddd53..75ba16638 100644 --- a/plugins/OStatus/actions/webfinger.php +++ b/plugins/OStatus/actions/webfinger.php @@ -58,6 +58,13 @@ class WebfingerAction extends Action $xrd->links[] = array('rel' => 'http://webfinger.net/rel/profile-page', 'type' => 'text/html', 'href' => common_profile_url($nick)); + + $salmon_url = common_local_url('salmon', + array('id' => $this->user->id)); + + $xrd->links[] = array('rel' => 'salmon', + 'href' => $salmon_url); + // TODO - finalize where the redirect should go on the publisher $url = common_local_url('ostatussub') . '?feed={uri}'; $xrd->links[] = array('rel' => 'http://ostatus.org/schema/1.0/subscribe', -- cgit v1.2.3-54-g00ecf