]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add route for /statuses/show
authorZach Copley <zach@status.net>
Thu, 1 Oct 2009 00:08:52 +0000 (17:08 -0700)
committerZach Copley <zach@status.net>
Thu, 1 Oct 2009 00:08:52 +0000 (17:08 -0700)
actions/apishow.php
lib/router.php

index 3d0b7b6e3ac9e50b5428ba9476d3336132009d36..d17cc8c95d030000c09776b9576a234067181f21 100644 (file)
@@ -83,7 +83,7 @@ class ApiShowAction extends TwitterapiAction
     /**
      * Handle the request
      *
-     * Just show the notices
+     * Check the format and show the notice
      *
      * @param array $args $_REQUEST data (unused)
      *
@@ -103,7 +103,7 @@ class ApiShowAction extends TwitterapiAction
     }
 
     /**
-     * Show the timeline of notices
+     * Show the notice
      *
      * @return void
      */
@@ -125,14 +125,14 @@ class ApiShowAction extends TwitterapiAction
 
             if (!empty($deleted)) {
                 $this->clientError(
-                    _('Status deleted.'), 
-                    410, 
+                    _('Status deleted.'),
+                    410,
                     $this->format
                 );
             } else {
                 $this->clientError(
                     _('No status with that ID found.'),
-                    404, 
+                    404,
                     $this->format
                 );
             }
index b3bb240d9a87f3c8c51f61ea11560f7df4e0cf57..972db4c9df6205e0eb3f645b32ac4587f1221a98 100644 (file)
@@ -332,10 +332,19 @@ class Router
                     'id' => '[a-zA-Z0-9]+',
                     'format' => '(xml|json)'));
 
+        $m->connect('api/statuses/show.:format',
+                    array('action' => 'ApiShow',
+                          'format' => '(xml|json)'));
+
+        $m->connect('api/statuses/show/:id.:format',
+                    array('action' => 'ApiShow',
+                          'id' => '[a-zA-Z0-9]+',
+                          'format' => '(xml|json)'));
+
         $m->connect('api/statuses/:method',
                     array('action' => 'api',
                           'apiaction' => 'statuses'),
-                    array('method' => '(update|show|featured)(\.(atom|rss|xml|json))?'));
+                    array('method' => '(update|featured)(\.(atom|rss|xml|json))?'));
 
         $m->connect('api/statuses/:method/:argument',
                     array('action' => 'api',