]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
generate links for apinamespace.org/atom and /twitter in userxrd
authorEvan Prodromou <evan@status.net>
Tue, 7 Dec 2010 20:53:34 +0000 (15:53 -0500)
committerEvan Prodromou <evan@status.net>
Tue, 7 Dec 2010 20:53:34 +0000 (15:53 -0500)
lib/xrdaction.php

index 177d1b471c16e894e7708286953fe03d3a2ae102..4377eab943bcb5e11eff1e8cfcdf67d2493227c6 100644 (file)
@@ -97,10 +97,23 @@ class XrdAction extends Action
                                   'href' => common_local_url('foaf',
                                                              array('nickname' => $nick)));
            
+            $xrd->links[] = array('rel' => 'http://apinamespace.org/atom',
+                                  'type' => 'application/atomsvc+xml',
+                                  'href' => common_local_url('ApiAtomService', array('id' => $nick)));
+
+            if (common_config('site', 'fancy')) {
+                $apiRoot = common_path('api/', true);
+            } else {
+                $apiRoot = common_path('index.php/api/', true);
+            }
+            
+            $xrd->links[] = array('rel' => 'http://apinamespace.org/twitter',
+                                  'href' => $apiRoot,
+                                  'property' => array(array('type' => 'http://apinamespace.org/twitter/username',
+                                                            'value' => $nick)));
 
             Event::handle('EndXrdActionLinks', array(&$xrd, $this->user));
         }
-           
 
         header('Content-type: application/xrd+xml');
         print $xrd->toXML();