$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)) {
$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.'));
}
}
}
$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.'));
}
}
}