]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Routes for friendships actions
authorZach Copley <zach@status.net>
Mon, 5 Oct 2009 17:04:35 +0000 (10:04 -0700)
committerZach Copley <zach@status.net>
Mon, 5 Oct 2009 17:04:35 +0000 (10:04 -0700)
lib/router.php

index 75abf58ab89a40f8f65009cc28879d9c0215cebb..5ee93965711d2183de3079daca64f66fc803b2e7 100644 (file)
@@ -388,17 +388,33 @@ class Router
 
         // friendships
 
-        $m->connect('api/friendships/:method/:argument',
-                    array('action' => 'api',
-                          'apiaction' => 'friendships'),
-                    array('method' => '(create|destroy)'));
+        $m->connect('api/friendships/show.:format',
+                    array('action' => 'ApiFriendshipsShow',
+                          'format' => '(xml|json)'));
 
-        $m->connect('api/friendships/:method',
-                    array('action' => 'api',
-                          'apiaction' => 'friendships'),
-                    array('method' => '(show|exists)(\.(xml|json))'));
+        $m->connect('api/friendships/exists.:format',
+                    array('action' => 'ApiFriendshipsExists',
+                          'format' => '(xml|json)'));
+
+        $m->connect('api/friendships/create.:format',
+                    array('action' => 'ApiFriendshipsCreate',
+                          'format' => '(xml|json)'));
+
+        $m->connect('api/friendships/destroy.:format',
+                     array('action' => 'ApiFriendshipsDestroy',
+                          'format' => '(xml|json)'));
+
+        $m->connect('api/friendships/create/:id.:format',
+                    array('action' => 'ApiFriendshipsCreate',
+                          'id' => '[a-zA-Z0-9]+',
+                          'format' => '(xml|json)'));
+
+        $m->connect('api/friendships/destroy/:id.:format',
+                    array('action' => 'ApiFriendshipsDestroy',
+                    'id' => '[a-zA-Z0-9]+',
+                    'format' => '(xml|json)'));
 
-       // Social graph
+        // Social graph
 
         $m->connect('api/friends/ids/:id.:format',
                     array('action' => 'apiFriends',