X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FCommand.php;h=c2409d140a2ac152c86ca780ffe36d288833bf42;hb=cad6f78fe66e73665fe736cfe78d6633e1120ea7;hp=9dfa867de631ea58c4042ca5eeb6fb785c24c3b4;hpb=7f1639fda15161db0b0b5c6c10824d7d515123f1;p=quix0rs-gnu-social.git diff --git a/classes/Command.php b/classes/Command.php index 9dfa867de6..c2409d140a 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)) { @@ -310,9 +315,9 @@ class OffCommand extends Command { $channel->error($this->user, _("Command not yet implemented.")); } else { if ($channel->off($this->user)) { - $channel->output(_('Notification off.')); + $channel->output($this->user, _('Notification off.')); } else { - $channel->error(_('Can\'t turn off notification.')); + $channel->error($this->user, _('Can\'t turn off notification.')); } } } @@ -330,9 +335,9 @@ class OnCommand extends Command { $channel->error($this->user, _("Command not yet implemented.")); } else { if ($channel->on($this->user)) { - $channel->output(_('Notification on.')); + $channel->output($this->user, _('Notification on.')); } else { - $channel->error(_('Can\'t turn on notification.')); + $channel->error($this->user, _('Can\'t turn on notification.')); } } }