Shorten the notice text after command processing is done

This commit is contained in:
Craig Andrews 2009-10-27 22:02:55 -04:00
parent 922ee7b3b2
commit 7b30e3c00f
1 changed files with 9 additions and 8 deletions

View File

@ -160,18 +160,12 @@ class NewnoticeAction extends Action
if (!$content) {
$this->clientError(_('No content!'));
} else {
$content_shortened = common_shorten_links($content);
if (Notice::contentTooLong($content_shortened)) {
$this->clientError(sprintf(_('That\'s too long. '.
'Max notice size is %d chars.'),
Notice::maxContent()));
}
return;
}
$inter = new CommandInterpreter();
$cmd = $inter->handle_command($user, $content_shortened);
$cmd = $inter->handle_command($user, $content);
if ($cmd) {
if ($this->boolean('ajax')) {
@ -182,6 +176,13 @@ class NewnoticeAction extends Action
return;
}
$content_shortened = common_shorten_links($content);
if (Notice::contentTooLong($content_shortened)) {
$this->clientError(sprintf(_('That\'s too long. '.
'Max notice size is %d chars.'),
Notice::maxContent()));
}
$replyto = $this->trimmed('inreplyto');
#If an ID of 0 is wrongly passed here, it will cause a database error,
#so override it...