* @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 ApiPrivateAuthAction
{
-
var $notice_id = null;
var $notice = null;
* @param array $args $_REQUEST args
*
* @return boolean success flag
- *
*/
-
function prepare($args)
{
parent::prepare($args);
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
if (!in_array($this->format, array('xml', 'json'))) {
+ // TRANS: Client error displayed when trying to handle an unknown API method.
$this->clientError(_('API method not found.'), $code = 404);
return;
}
*
* @return void
*/
-
function showNotice()
{
if (!empty($this->notice)) {
$this->show_single_json_status($this->notice);
}
} else {
-
// XXX: Twitter just sets a 404 header and doens't bother
// to return an err msg
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
*
* @return boolean true
*/
-
function isReadOnly($args)
{
return true;
*
* @return string datestamp of the latest notice in the stream
*/
-
function lastModified()
{
if (!empty($this->notice)) {
*
* @return string etag
*/
-
function etag()
{
if (!empty($this->notice)) {
return '"' . implode(
':',
array($this->arg('action'),
+ common_user_cache_hash($this->auth_user),
common_language(),
$this->notice->id,
strtotime($this->notice->created))
return null;
}
-
}