$this->other = User::staticGet('id', $this->to);
if (!$this->other) {
- $this->clientError(_('No such user'), 404);
+ $this->clientError(_('No such user.'), 404);
return false;
}
$this->showForm(_('No content!'));
return;
} else {
- $content_shortened = common_shorten_links($this->content);
+ $content_shortened = $user->shortenLinks($this->content);
if (Message::contentTooLong($content_shortened)) {
- $this->showForm(sprintf(_('That\'s too long. ' .
- 'Max message size is %d chars.'),
+ // TRANS: Form validation error displayed when message content is too long.
+ // TRANS: %d is the maximum number of characters for a message.
+ $this->showForm(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()));
return;
}
return;
}
- $this->notify($user, $this->other, $message);
+ $message->notify();
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementEnd('head');
$this->elementStart('body');
$this->element('p', array('id' => 'command_result'),
- sprintf(_('Direct message to %s sent'),
+ sprintf(_('Direct message to %s sent.'),
$this->other->nickname));
$this->elementEnd('body');
$this->elementEnd('html');
}
}
- function notify($from, $to, $message)
- {
- mail_notify_message($message, $from, $to);
- // XXX: Jabber, SMS notifications... probably queued
- }
-
// Do nothing (override)
function showNoticeForm()