]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/xrdaction.php
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
[quix0rs-gnu-social.git] / lib / xrdaction.php
index 177d1b471c16e894e7708286953fe03d3a2ae102..b59e0f78a40f3c2dab4a8eb43053f2d2b579f5c1 100644 (file)
@@ -97,10 +97,25 @@ 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)),
+                                  'property' => array(array('type' => 'http://apinamespace.org/atom/username',
+                                                            'value' => $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();
@@ -132,4 +147,16 @@ class XrdAction extends Action
 
         return (substr($uri, 0, 5) == 'acct:');
     }
+
+    /**
+     * Is this action read-only?
+     *
+     * @param array $args other arguments
+     *
+     * @return boolean is read only action?
+     */
+    function isReadOnly($args)
+    {
+        return true;
+    }
 }