]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/newnotice.php
save notice to inbox on saveNew
[quix0rs-gnu-social.git] / actions / newnotice.php
index b576e1326641b0c593feae507b644e8742366e72..b5fc98c37c904d662200da2653931f5199be889e 100644 (file)
@@ -43,12 +43,27 @@ class NewnoticeAction extends Action {
                if (!$content) {
                        $this->show_form(_('No content!'));
                        return;
-               } else if (strlen($content) > 140) {
+               } else if (mb_strlen($content) > 140) {
+                       common_debug("Content = '$content'", __FILE__);
+                       common_debug("mb_strlen(\$content) = " . mb_strlen($content), __FILE__);
                        $this->show_form(_('That\'s too long. Max notice size is 140 chars.'));
                        return;
                }
 
-               $notice = Notice::saveNew($user->id, $content, 'web');
+               $inter = new CommandInterpreter();
+               
+               $cmd = $inter->handle_command($user, $content);
+               
+               if ($cmd) {
+                       $cmd->execute(new WebChannel());
+                       return;
+               }
+
+               $replyto = $this->trimmed('inreplyto');
+
+               common_debug("Replyto = $replyto\n");
+               
+               $notice = Notice::saveNew($user->id, $content, 'web', 1, ($replyto == 'false') ? NULL : $replyto);
                
                if (is_string($notice)) {
                        $this->show_form($notice);