]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Command.php
better header for not-modified message
[quix0rs-gnu-social.git] / classes / Command.php
index 9dfa867de631ea58c4042ca5eeb6fb785c24c3b4..c2409d140a2ac152c86ca780ffe36d288833bf42 100644 (file)
@@ -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.'));
                        }
                }
        }