From: Evan Prodromou Date: Mon, 15 Nov 2010 16:57:19 +0000 (-0500) Subject: Merge branch 'atompub' into 0.9.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c1cee3b27ffa1529009195604c5495bef4f83bc2;p=quix0rs-gnu-social.git Merge branch 'atompub' into 0.9.x Conflicts: actions/apistatusesshow.php actions/apitimelineuser.php --- c1cee3b27ffa1529009195604c5495bef4f83bc2 diff --cc actions/apistatusesshow.php index a98e45f79c,86ffd6862e..f4a79ddbcb --- a/actions/apistatusesshow.php +++ b/actions/apistatusesshow.php @@@ -100,9 -105,8 +100,9 @@@ class ApiStatusesShowAction extends Api { parent::handle($args); - if (!in_array($this->format, array('xml', 'json'))) { + if (!in_array($this->format, array('xml', 'json', 'atom'))) { + // TRANS: Client error displayed when trying to handle an unknown API method. - $this->clientError(_('API method not found.'), $code = 404); + $this->clientError(_('API method not found.'), 404); return; } @@@ -117,12 -131,22 +127,20 @@@ 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 { - // XXX: Twitter just sets a 404 header and doens't bother // to return an err msg diff --cc actions/apitimelineuser.php index 0046c462d7,7e76636460..e4a8b596ee --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@@ -132,16 -142,17 +137,16 @@@ class ApiTimelineUserAction extends Api break; case 'rss': $this->showRssTimeline( - $this->notices, - $atom->title, - $link, - $atom->subtitle, - $suplink, - $atom->logo, - $self - ); + $this->notices, + $atom->title, + $link, + $atom->subtitle, + $suplink, + $atom->logo, + $self + ); break; case 'atom': - header('Content-Type: application/atom+xml; charset=utf-8'); $atom->setId($self);