* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
- $this->clientError(_('No such user.'), 404, $this->format);
- return;
+ // TRANS: Client error when user not found for an API direct message action.
+ $this->clientError(_('No such user.'), 404);
$user_param = $this->trimmed('user');
$user_id = $this->arg('user_id');
$screen_name = $this->trimmed('screen_name');
if (isset($user_param) || isset($user_id) || isset($screen_name)) {
$user_param = $this->trimmed('user');
$user_id = $this->arg('user_id');
$screen_name = $this->trimmed('screen_name');
if (isset($user_param) || isset($user_id) || isset($screen_name)) {
- sprintf(
- _('That\'s too long. Max message size is %d chars.'),
- Message::maxContent()
- ),
- 406,
- $this->format
- );
- return;
+ sprintf(_m('That\'s too long. Maximum message size is %d character.', 'That\'s too long. Maximum message size is %d characters.', Message::maxContent()), Message::maxContent()),
+ 406);
- if (empty($this->other)) {
- $this->clientError(_('Recipient user not found.'), 403, $this->format);
- return;
+ if (!$this->other instanceof Profile) {
+ // TRANS: Client error displayed if a recipient user could not be found (403).
+ $this->clientError(_('Recipient user not found.'), 403);
- $this->clientError(
- _('Can\'t send direct messages to users who aren\'t your friend.'),
- 403,
- $this->format
- );
- return;
+ // TRANS: Client error displayed trying to direct message another user who's not a friend (403).
+ $this->clientError(_('Cannot send direct messages to users who aren\'t your friend.'), 403);
} else if ($this->user->id == $this->other->id) {
// Note: sending msgs to yourself is allowed by Twitter
} else if ($this->user->id == $this->other->id) {
// Note: sending msgs to yourself is allowed by Twitter
- $errmsg = 'Don\'t send a message to yourself; ' .
- 'just say it to yourself quietly instead.';
-
- $this->clientError(_($errmsg), 403, $this->format);
- return;
+ // TRANS: Client error displayed trying to direct message self (403).
+ $this->clientError(_('Do not send a message to yourself; just say it to yourself quietly instead.'), 403);