}
function save_new_message() {
-
$user = common_current_user();
assert($user); # XXX: maybe an error instead...
if (!$content) {
$this->show_form(_('No content!'));
return;
- } else if (mb_strlen($content) > 140) {
- common_debug("Content = '$content'", __FILE__);
- common_debug("mb_strlen(\$content) = " . mb_strlen($content), __FILE__);
- $this->show_form(_('That\'s too long. Max message size is 140 chars.'));
- return;
+// } else if (mb_strlen($content) > 140) {
+ } else {
+ $content = common_shorten_links($content);
+
+ if (mb_strlen($content) > 140) {
+ common_debug("Content = '$content'", __FILE__);
+ common_debug("mb_strlen(\$content) = " . mb_strlen($content), __FILE__);
+ $this->show_form(_('That\'s too long. Max message size is 140 chars.'));
+ return;
+ }
}
$other = User::staticGet('id', $to);
$this->notify($user, $other, $message);
- $url = common_local_url('showmessage',
- array('message' => $message->id));
+ $url = common_local_url('outbox', array('nickname' => $user->nickname));
common_redirect($url, 303);
}