summaryrefslogtreecommitdiff
path: root/plugins/OStatus/actions
diff options
context:
space:
mode:
authorJames Walker <walkah@walkah.net>2010-02-22 23:11:40 -0500
committerJames Walker <walkah@walkah.net>2010-02-22 23:30:31 -0500
commitf4b34d67c54022b70185e83fe628c17e3656d91f (patch)
tree7c42b2ba0776227f528365d81d95c51cc00389c5 /plugins/OStatus/actions
parent74f5c1e16968110caefeeb8431869897f2f8ddfb (diff)
generate keypairs for users, and put them in the XRD for discovery
Diffstat (limited to 'plugins/OStatus/actions')
-rw-r--r--plugins/OStatus/actions/webfinger.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/OStatus/actions/webfinger.php b/plugins/OStatus/actions/webfinger.php
index cf60b8069..fbbd8d039 100644
--- a/plugins/OStatus/actions/webfinger.php
+++ b/plugins/OStatus/actions/webfinger.php
@@ -71,6 +71,17 @@ class WebfingerAction extends Action
$xrd->links[] = array('rel' => 'salmon',
'href' => $salmon_url);
+ // Get this user's keypair
+ $magickey = Magicsig::staticGet('user_id', $this->user->id);
+ if (!$magickey) {
+ // No keypair yet, let's generate one.
+ $magickey = new Magicsig();
+ $magickey->generate();
+ }
+
+ $xrd->links[] = array('rel' => Magicsig::PUBLICKEYREL,
+ 'href' => 'data:application/magic-public-key;'. $magickey->keypair);
+
// TODO - finalize where the redirect should go on the publisher
$url = common_local_url('ostatussub') . '?profile={uri}';
$xrd->links[] = array('rel' => 'http://ostatus.org/schema/1.0/subscribe',