]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/lib/xrdaction.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / plugins / OStatus / lib / xrdaction.php
index 6881292add2a3c58afaf0fed1487aa5252eaddf0..c8b5beff379732d7bee653324071558e9035ffd2 100644 (file)
@@ -26,13 +26,12 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
 class XrdAction extends Action
 {
-
     public $uri;
-    
+
     public $user;
 
     public $xrd;
-    
+
     function handle()
     {
         $nick =  $this->user->nickname;
@@ -46,10 +45,10 @@ class XrdAction extends Action
         if (empty($xrd->subject)) {
             $xrd->subject = Discovery::normalize($this->uri);
         }
-        $xrd->alias[] = common_profile_url($nick);
+        $xrd->alias[] = $this->user->uri;
         $xrd->links[] = array('rel' => Discovery::PROFILEPAGE,
                               'type' => 'text/html',
-                              'href' => common_profile_url($nick));
+                              'href' => $this->user->uri);
 
         $xrd->links[] = array('rel' => Discovery::UPDATESFROM,
                               'href' => common_local_url('ApiTimelineUser',
@@ -65,7 +64,7 @@ class XrdAction extends Action
         // XFN
         $xrd->links[] = array('rel' => 'http://gmpg.org/xfn/11',
                               'type' => 'text/html',
-                              'href' => common_profile_url($nick));
+                              'href' => $this->user->uri);
         // FOAF
         $xrd->links[] = array('rel' => 'describedby',
                               'type' => 'application/rdf+xml',
@@ -76,6 +75,9 @@ class XrdAction extends Action
         $salmon_url = common_local_url('usersalmon',
                                        array('id' => $this->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);
 
@@ -91,15 +93,14 @@ class XrdAction extends Action
         }
 
         $xrd->links[] = array('rel' => Magicsig::PUBLICKEYREL,
-                              'href' => 'data:application/magic-public-key;'. $magickey->toString(false));
+                              '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 );
 
-        header('Content-type: text/xml');
+        header('Content-type: application/xrd+xml');
         print $xrd->toXML();
     }
-
 }