- $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)) {
if (Message::contentTooLong($content_shortened)) {
// TRANS: Client error displayed when message content is too long.
// TRANS: %d is the maximum number of characters for a message.
$this->clientError(
if (Message::contentTooLong($content_shortened)) {
// TRANS: Client error displayed when message content is too long.
// TRANS: %d is the maximum number of characters for a message.
$this->clientError(
- 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,
- $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);
- $this->clientError(
- // TRANS: Client error displayed trying to direct message another user who's not a friend (403).
- _('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
// TRANS: Client error displayed trying to direct message self (403).
} else if ($this->user->id == $this->other->id) {
// Note: sending msgs to yourself is allowed by Twitter
// 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, $this->format);
- return;
+ $this->clientError(_('Do not send a message to yourself; just say it to yourself quietly instead.'), 403);