]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Fix for crash found by potter if you set up two redirects in two channels to forward...
[user/henk/code/inspircd.git] / src / command_parse.cpp
index bf04960bd8a887f3d613c80f53ee95844e61d859..0fa7c05b2783efefe9d9e6a2ebc3c5d19909ff42 100644 (file)
@@ -289,6 +289,14 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
        std::string command;
        tokens.GetToken(command);
 
+       /* A client sent a nick prefix on their command (ick)
+        * rhapsody and some braindead bouncers do this --
+        * the rfc says they shouldnt but also says the ircd should
+        * discard it if they do.
+        */
+       if (*command.c_str() == ':')
+               tokens.GetToken(command);
+
        while (tokens.GetToken(para[items]) && (items < 127))
        {
                command_p[items] = para[items].c_str();
@@ -334,7 +342,7 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
                        {
                                user->WriteServ("461 %s %s :Not enough parameters.", user->nick, command.c_str());
                                /* If syntax is given, display this as the 461 reply */
-                               if ((ServerInstance->Config->SyntaxHints) && (cm->second->syntax.length()))
+                               if ((ServerInstance->Config->SyntaxHints) && (user->registered == REG_ALL) && (cm->second->syntax.length()))
                                        user->WriteServ("304 %s :SYNTAX %s %s", user->nick, cm->second->command.c_str(), cm->second->syntax.c_str());
                                return;
                        }