X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Frsd.php;h=bd8042f0cd86cc3a10945a25b01c8d1f32f11bd2;hb=6924bb1d290643da7b4ffb13d9fbb09afaaba22c;hp=f88bf2e9a8bbfaedd7d33a0748bb0a880ac895d8;hpb=3cb6b1670bd7e3860fdca217e4075f51378fe5e0;p=quix0rs-gnu-social.git diff --git a/actions/rsd.php b/actions/rsd.php index f88bf2e9a8..bd8042f0cd 100644 --- a/actions/rsd.php +++ b/actions/rsd.php @@ -68,13 +68,11 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://status.net/ */ - class RsdAction extends Action { /** * Optional attribute for the personal rsd.xml file. */ - var $user = null; /** @@ -87,7 +85,6 @@ class RsdAction extends Action * * @return boolean success flag */ - function prepare($args) { parent::prepare($args); @@ -104,17 +101,14 @@ class RsdAction extends Action // Permanent redirect on non-canonical nickname if ($nickname_arg != $nickname) { - common_redirect(common_local_url('rsd', - array('nickname' => $nickname)), - 301); - return false; + common_redirect(common_local_url('rsd', array('nickname' => $nickname)), 301); } - $this->user = User::staticGet('nickname', $nickname); + $this->user = User::getKV('nickname', $nickname); if (empty($this->user)) { + // TRANS: Client error. $this->clientError(_('No such user.'), 404); - return false; } } @@ -132,7 +126,6 @@ class RsdAction extends Action * * @return nothing */ - function handle($args) { header('Content-Type: application/rsd+xml'); @@ -143,6 +136,7 @@ class RsdAction extends Action $this->elementStart('rsd', array('version' => '1.0', 'xmlns' => $rsdNS)); $this->elementStart('service'); + // TRANS: Engine name for RSD. $this->element('engineName', null, _('StatusNet')); $this->element('engineLink', null, 'http://status.net/'); $this->elementStart('apis'); @@ -157,11 +151,25 @@ class RsdAction extends Action $this->elementStart('api', $apiAttrs); $this->elementStart('settings'); $this->element('docs', null, - 'http://status.net/wiki/TwitterCompatibleAPI'); + common_local_url('doc', array('title' => 'api'))); $this->element('setting', array('name' => 'OAuth'), 'true'); $this->elementEnd('settings'); $this->elementEnd('api'); + + // Atom API + + if (empty($this->user)) { + $service = common_local_url('ApiAtomService'); + } else { + $service = common_local_url('ApiAtomService', array('id' => $this->user->nickname)); + } + + $this->element('api', array('name' => 'Atom', + 'preferred' => 'false', + 'apiLink' => $service, + 'blogID' => $blogID)); + Event::handle('EndRsdListApis', array($this, $this->user)); } $this->elementEnd('apis'); @@ -181,7 +189,6 @@ class RsdAction extends Action * * @return string date of last change of this page */ - function lastModified() { if (!empty($this->user)) { @@ -200,7 +207,6 @@ class RsdAction extends Action * * @return boolean true */ - function isReadOnly($args) { return true; @@ -214,7 +220,6 @@ class RsdAction extends Action * * @return string API root URI for this site */ - private function _apiRoot() { if (common_config('site', 'fancy')) {