diff options
Diffstat (limited to 'plugins/OStatus/OStatusPlugin.php')
-rw-r--r-- | plugins/OStatus/OStatusPlugin.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index e38d52d3d..8aedebe41 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -1017,4 +1017,38 @@ class OStatusPlugin extends Plugin 'template' => $url, 'title' => array('Resource Descriptor')); } + + function onEndXrdActionLinks(&$xrd, $user) + { + // Salmon + $salmon_url = common_local_url('usersalmon', + array('id' => $user->id)); + + $xrd->links[] = array('rel' => Salmon::REL_SALMON, + 'href' => $salmon_url); + // XXX : Deprecated - to be removed. + $xrd->links[] = array('rel' => Salmon::NS_REPLIES, + 'href' => $salmon_url); + + $xrd->links[] = array('rel' => Salmon::NS_MENTIONS, + 'href' => $salmon_url); + + // Get this user's keypair + $magickey = Magicsig::staticGet('user_id', $user->id); + if (!$magickey) { + // No keypair yet, let's generate one. + $magickey = new Magicsig(); + $magickey->generate($user->id); + } + + $xrd->links[] = array('rel' => Magicsig::PUBLICKEYREL, + 'href' => 'data:application/magic-public-key,'. $magickey->toString(false)); + + // 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', + 'template' => $url ); + + return true; + } } |