From 15c1d4f5e4947b9c60439ab5a17694ad57d06704 Mon Sep 17 00:00:00 2001 From: millette Date: Thu, 6 Nov 2008 15:59:26 -0500 Subject: trac31 url_auto_shortening by sgmurphy darcs-hash:20081106205926-099f7-6bcfd7969a159a12b1ba6a9ee254e44a07b94761.gz --- classes/Command.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'classes/Command.php') diff --git a/classes/Command.php b/classes/Command.php index 0795f86af..c2409d140 100644 --- a/classes/Command.php +++ b/classes/Command.php @@ -197,9 +197,14 @@ class MessageCommand extends Command { $channel->error($this->user, _('No content!')); return; } else if ($len > 140) { - $channel->error($this->user, sprintf(_('Message too long - maximum is 140 characters, you sent %d'), $len)); - return; - } else if (!$other) { + $content = common_shorten_links($content); + if (mb_strlen($content) > 140) { + $channel->error($this->user, sprintf(_('Message too long - maximum is 140 characters, you sent %d'), $len)); + return; + } + } + + if (!$other) { $channel->error($this->user, _('No such user.')); return; } else if (!$this->user->mutuallySubscribed($other)) { -- cgit v1.2.3-54-g00ecf