]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apistatusesshow.php
Much more reliable Facebook SSO
[quix0rs-gnu-social.git] / actions / apistatusesshow.php
index 3be22ca59792340cda63914634bf2c37091be5a8..a98e45f79ca04776b67a9e8de706dd8b27b04fe7 100644 (file)
@@ -29,6 +29,7 @@
  * @author    Robin Millette <robin@millette.info>
  * @author    Zach Copley <zach@status.net>
  * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
@@ -37,7 +38,7 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/api.php';
+require_once INSTALLDIR . '/lib/apiprivateauth.php';
 
 /**
  * Returns the notice specified by id as a Twitter-style status and inline user
@@ -54,10 +55,8 @@ require_once INSTALLDIR . '/lib/api.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
-
-class ApiStatusesShowAction extends ApiAction
+class ApiStatusesShowAction extends ApiPrivateAuthAction
 {
-
     var $notice_id = null;
     var $notice    = null;
 
@@ -67,9 +66,7 @@ class ApiStatusesShowAction extends ApiAction
      * @param array $args $_REQUEST args
      *
      * @return boolean success flag
-     *
      */
-
     function prepare($args)
     {
         parent::prepare($args);
@@ -99,13 +96,13 @@ class ApiStatusesShowAction extends ApiAction
      *
      * @return void
      */
-
     function handle($args)
     {
         parent::handle($args);
 
         if (!in_array($this->format, array('xml', 'json'))) {
-            $this->clientError(_('API method not found!'), $code = 404);
+            // TRANS: Client error displayed when trying to handle an unknown API method.
+            $this->clientError(_('API method not found.'), $code = 404);
             return;
         }
 
@@ -117,7 +114,6 @@ class ApiStatusesShowAction extends ApiAction
      *
      * @return void
      */
-
     function showNotice()
     {
         if (!empty($this->notice)) {
@@ -127,7 +123,6 @@ class ApiStatusesShowAction extends ApiAction
                 $this->show_single_json_status($this->notice);
             }
         } else {
-
             // XXX: Twitter just sets a 404 header and doens't bother
             // to return an err msg
 
@@ -135,12 +130,14 @@ class ApiStatusesShowAction extends ApiAction
 
             if (!empty($deleted)) {
                 $this->clientError(
+                    // TRANS: Client error displayed requesting a deleted status.
                     _('Status deleted.'),
                     410,
                     $this->format
                 );
             } else {
                 $this->clientError(
+                    // TRANS: Client error displayed requesting a status with an invalid ID.
                     _('No status with that ID found.'),
                     404,
                     $this->format
@@ -156,7 +153,6 @@ class ApiStatusesShowAction extends ApiAction
      *
      * @return boolean true
      */
-
     function isReadOnly($args)
     {
         return true;
@@ -167,7 +163,6 @@ class ApiStatusesShowAction extends ApiAction
      *
      * @return string datestamp of the latest notice in the stream
      */
-
     function lastModified()
     {
         if (!empty($this->notice)) {
@@ -185,7 +180,6 @@ class ApiStatusesShowAction extends ApiAction
      *
      * @return string etag
      */
-
     function etag()
     {
         if (!empty($this->notice)) {
@@ -193,6 +187,7 @@ class ApiStatusesShowAction extends ApiAction
             return '"' . implode(
                 ':',
                 array($this->arg('action'),
+                      common_user_cache_hash($this->auth_user),
                       common_language(),
                       $this->notice->id,
                       strtotime($this->notice->created))
@@ -202,5 +197,4 @@ class ApiStatusesShowAction extends ApiAction
 
         return null;
     }
-
 }