summaryrefslogtreecommitdiff
path: root/classes/Command.php
diff options
context:
space:
mode:
authormillette <millette@controlyourself.ca>2008-11-06 15:59:26 -0500
committermillette <millette@controlyourself.ca>2008-11-06 15:59:26 -0500
commit15c1d4f5e4947b9c60439ab5a17694ad57d06704 (patch)
tree4139f40409a3765a9a4dbf4b6922fd7232f43441 /classes/Command.php
parent1e8d26baecad6ca1088ea7815fe2615fb520a10e (diff)
trac31 url_auto_shortening by sgmurphy
darcs-hash:20081106205926-099f7-6bcfd7969a159a12b1ba6a9ee254e44a07b94761.gz
Diffstat (limited to 'classes/Command.php')
-rw-r--r--classes/Command.php11
1 files changed, 8 insertions, 3 deletions
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)) {