]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Missing include breaks "make clean" on the cmd_* files
[user/henk/code/inspircd.git] / src / command_parse.cpp
index 157162bce90c4524a817c1249029a87c63cf62b7..386f0932176a46e5a92becbab3ec9ebebc3ffad4 100644 (file)
@@ -236,11 +236,11 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
                                        WriteServ(user->fd,"481 %s :Permission Denied- You do not have the required operator privilages",user->nick);
                                        return;
                                }
-                       }
-                       if ((cm->second->flags_needed) && (!user->HasPermission(command)))
-                       {
-                               WriteServ(user->fd,"481 %s :Permission Denied- Oper type %s does not have access to command %s",user->nick,user->oper,command.c_str());
-                               return;
+                               if (!user->HasPermission(command))
+                               {
+                                       WriteServ(user->fd,"481 %s :Permission Denied- Oper type %s does not have access to command %s",user->nick,user->oper,command.c_str());
+                                       return;
+                               }
                        }
                        if ((user->registered == REG_ALL) && (!*user->oper) && (cm->second->IsDisabled()))
                        {
@@ -250,16 +250,10 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
                        }
                        if (items < cm->second->min_params)
                        {
+                               WriteServ(user->fd,"461 %s %s :Not enough parameters.", user->nick, command.c_str());
                                /* If syntax is given, display this as the 461 reply */
-                               if (cm->second->syntax.length())
-                               {
-                                       WriteServ(user->fd,"461 %s %s :Not enough parameters.", user->nick, command.c_str());
-                                       /* Use RPL_TEXT for this */
-                                       if (Config->SyntaxHints)
-                                               WriteServ(user->fd,"304 %s :SYNTAX %s %s", user->nick, cm->second->command.c_str(), cm->second->syntax.c_str());
-                               }
-                               else
-                                       WriteServ(user->fd,"461 %s %s :Not enough parameters", user->nick, command.c_str());
+                               if ((Config->SyntaxHints) && (cm->second->syntax.length()))
+                                       WriteServ(user->fd,"304 %s :SYNTAX %s %s", user->nick, cm->second->command.c_str(), cm->second->syntax.c_str());
                                return;
                        }
                        if ((user->registered == REG_ALL) || (cm->second == command_user) || (cm->second == command_nick) || (cm->second == command_pass))