X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiaccountupdatedeliverydevice.php;h=a36806b216cd8f3dc647d19e473d1c9f6c8a7bf4;hb=7cf12f093ed48849ec901038b4cfd44595343c06;hp=2d903cb46087fe51bee5f0afac8d59849e4ac256;hpb=0f1fc36a05c8d858827718255bef20e8d0c0d3f6;p=quix0rs-gnu-social.git diff --git a/actions/apiaccountupdatedeliverydevice.php b/actions/apiaccountupdatedeliverydevice.php index 2d903cb460..a36806b216 100644 --- a/actions/apiaccountupdatedeliverydevice.php +++ b/actions/apiaccountupdatedeliverydevice.php @@ -45,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 { /** @@ -54,9 +53,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction * @param array $args $_REQUEST args * * @return boolean success flag - * */ - function prepare($args) { parent::prepare($args); @@ -76,7 +73,6 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction * * @return void */ - function handle($args) { parent::handle($args); @@ -92,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 @@ -102,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; } @@ -121,16 +116,23 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction if (strtolower($this->device) == 'sms') { $this->user->smsnotify = true; } elseif (strtolower($this->device) == 'im') { - $this->user->jabbernotify = true; + //TODO IM is pluginized now, so what should we do? + //Enable notifications for all IM plugins? + //For now, don't do anything + //$this->user->jabbernotify = true; } elseif (strtolower($this->device == 'none')) { $this->user->smsnotify = false; - $this->user->jabbernotify = false; + //TODO IM is pluginized now, so what should we do? + //Disable notifications for all IM plugins? + //For now, don't do anything + //$this->user->jabbernotify = false; } $result = $this->user->update($original); 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; } @@ -147,7 +149,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'); @@ -155,5 +157,4 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction $this->endDocument('json'); } } - }