summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-10-24 15:58:53 -0400
committerEvan Prodromou <evan@status.net>2010-10-24 15:58:53 -0400
commit43a67b150a4e4285224ccf695171df731c736a1e (patch)
tree0988e83d344c0a27570dc2c09db527817df670f9 /actions
parent69a1ecec9b4b7168fb570d2d07bcfaa0f29fc856 (diff)
show a single notice in atom entry format
Diffstat (limited to 'actions')
-rw-r--r--actions/apistatusesshow.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/actions/apistatusesshow.php b/actions/apistatusesshow.php
index 84f8079db..c0eab15a4 100644
--- a/actions/apistatusesshow.php
+++ b/actions/apistatusesshow.php
@@ -105,8 +105,8 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
{
parent::handle($args);
- if (!in_array($this->format, array('xml', 'json'))) {
- $this->clientError(_('API method not found.'), $code = 404);
+ if (!in_array($this->format, array('xml', 'json', 'atom'))) {
+ $this->clientError(_('API method not found.'), 404);
return;
}
@@ -122,10 +122,18 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
function showNotice()
{
if (!empty($this->notice)) {
- if ($this->format == 'xml') {
+ switch ($this->format) {
+ case 'xml':
$this->showSingleXmlStatus($this->notice);
- } elseif ($this->format == 'json') {
+ break;
+ case 'json':
$this->show_single_json_status($this->notice);
+ break;
+ case 'atom':
+ $this->showSingleAtomStatus($this->notice);
+ break;
+ default:
+ throw new Exception(sprintf(_("Unsupported format: %s"), $this->format));
}
} else {