]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Twitter-compatible API - moved show() to the right file
authorzach <zach@controlyourself.ca>
Tue, 19 Aug 2008 00:39:31 +0000 (20:39 -0400)
committerzach <zach@controlyourself.ca>
Tue, 19 Aug 2008 00:39:31 +0000 (20:39 -0400)
darcs-hash:20080819003931-462f3-4b5b838a2fc5f872391581a189d33abdd8eeb744.gz

actions/twitapistatuses.php
lib/twitterapi.php

index 6a63dd03778e07da23fa36497d56509c033701d5..66d3737fda0600784afbd669b6782ab2d461c532 100644 (file)
@@ -530,6 +530,27 @@ class TwitapistatusesAction extends TwitterapiAction {
 
        }
 
+       function show($args, $apidata) {
+               parent::handle($args);
+               
+               $notice_id = $apidata['api_arg'];               
+               $notice = Notice::staticGet($notice_id);
+
+               if ($notice) {
+                       if ($apidata['content-type'] == 'xml') { 
+                               $this->show_single_xml_status($notice);
+                       } elseif ($apidata['content-type'] == 'json') {
+                               $this->show_single_json_status($notice);
+                       }
+               } else {
+                       
+                       // XXX: This is all that Twitter does.  It doesn't show an XML or JSON error msg.
+                       // Should we call client_error() to be more consistent?
+                       header('HTTP/1.1 404 Not Found');
+               }
+               
+               exit();
+       }
 
 
        /*
index f06c1d18868d2b065f7b00d012e9447ac652e6ec..096dee2696060d1f25b7e32e2697a4065cecc233 100644 (file)
@@ -150,28 +150,6 @@ class TwitterapiAction extends Action {
        function show_twitter_json_users($twitter_users) {
                print(json_encode($twitter_users));
        }
-
-       function show($args, $apidata) {
-               parent::handle($args);
-               
-               $id = $apidata['api_arg'];              
-               $notice = Notice::staticGet($id);
-
-               if ($notice) {
-                       if ($apidata['content-type'] == 'xml') { 
-                               $this->show_single_xml_status($notice);
-                       } elseif ($apidata['content-type'] == 'json') {
-                               $this->show_single_json_status($notice);
-                       }
-               } else {
-                       
-                       // XXX: This is all that Twitter does.  It doesn't show an XML or JSON error msg.
-                       // Should we call client_error() to be more consistent?
-                       header('HTTP/1.1 404 Not Found');
-               }
-               
-               exit();
-       }
                
        function show_single_xml_status($notice) {
                $this->init_document('xml');