X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiaccountupdatedeliverydevice.php;h=a9ccb4fca8062aef3b8c848599d839a10753eb7d;hb=dbd496f9014adee1d003c08366795a292cf73776;hp=05d19c22dea8d63ab5e3ee849daafe88d1df8f19;hpb=61098faf5dd2685ea00c110bb4a3c871da17a300;p=quix0rs-gnu-social.git diff --git a/actions/apiaccountupdatedeliverydevice.php b/actions/apiaccountupdatedeliverydevice.php index 05d19c22de..a9ccb4fca8 100644 --- a/actions/apiaccountupdatedeliverydevice.php +++ b/actions/apiaccountupdatedeliverydevice.php @@ -21,6 +21,7 @@ * * @category API * @package StatusNet + * @author Siebrand Mazeland * @author Zach Copley * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 @@ -44,7 +45,6 @@ require_once INSTALLDIR . '/lib/apiauth.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 ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction { /** @@ -53,9 +53,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction * @param array $args $_REQUEST args * * @return boolean success flag - * */ - function prepare($args) { parent::prepare($args); @@ -75,13 +73,13 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction * * @return void */ - function handle($args) { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { $this->clientError( + // TRANS: Client error message. POST is a HTTP command. It should not be translated. _('This method requires a POST.'), 400, $this->format ); @@ -90,6 +88,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction if (!in_array($this->format, array('xml', 'json'))) { $this->clientError( + // TRANS: Client error displayed handling a non-existing API method. _('API method not found.'), 404, $this->format @@ -100,16 +99,14 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction // Note: Twitter no longer supports IM if (!in_array(strtolower($this->device), array('sms', 'im', 'none'))) { - $this->clientError( - _( - 'You must specify a parameter named ' . - '\'device\' with a value of one of: sms, im, none.' - ) - ); + // TRANS: Client error displayed when no valid device parameter is provided for a user's delivery device setting. + $this->clientError(_( 'You must specify a parameter named ' . + '\'device\' with a value of one of: sms, im, none.' )); return; } if (empty($this->user)) { + // TRANS: Client error displayed when no existing user is provided for a user's delivery device setting. $this->clientError(_('No such user.'), 404, $this->format); return; } @@ -129,6 +126,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction if ($result === false) { common_log_db_error($this->user, 'UPDATE', __FILE__); + // TRANS: Server error displayed when a user's delivery device cannot be updated. $this->serverError(_('Could not update user.')); return; } @@ -145,7 +143,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction if ($this->format == 'xml') { $this->initDocument('xml'); - $this->showTwitterXmlUser($twitter_user); + $this->showTwitterXmlUser($twitter_user, 'user', true); $this->endDocument('xml'); } elseif ($this->format == 'json') { $this->initDocument('json'); @@ -153,5 +151,4 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction $this->endDocument('json'); } } - }