diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-06-12 20:32:10 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-06-12 20:32:10 +0200 |
commit | cfa32a6561e0152ebbd7135eaec9f7c794c170b1 (patch) | |
tree | 4c2d00aeee9de1014a336494b1e4ac3935f5b51b /src/commands | |
parent | 98f3924960d849691abc81e0928dc43ad9233b01 (diff) |
CommandParser::LoopCall() changes
- Change function to be static, return a bool
- Do not filter duplicates when there are 2 lists (JOIN)
- Remove validation of 'extra' parameter, caller must pass either a valid index or -1
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_join.cpp | 4 | ||||
-rw-r--r-- | src/commands/cmd_kick.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_kill.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_names.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_part.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_privmsg.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_whois.cpp | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/src/commands/cmd_join.cpp b/src/commands/cmd_join.cpp index a88509bc2..9e2678b5d 100644 --- a/src/commands/cmd_join.cpp +++ b/src/commands/cmd_join.cpp @@ -52,7 +52,7 @@ CmdResult CommandJoin::HandleLocal(const std::vector<std::string>& parameters, L { if (parameters.size() > 1) { - if (ServerInstance->Parser->LoopCall(user, this, parameters, 0, 1, false)) + if (CommandParser::LoopCall(user, this, parameters, 0, 1, false)) return CMD_SUCCESS; if (ServerInstance->IsChannel(parameters[0])) @@ -63,7 +63,7 @@ CmdResult CommandJoin::HandleLocal(const std::vector<std::string>& parameters, L } else { - if (ServerInstance->Parser->LoopCall(user, this, parameters, 0, -1, false)) + if (CommandParser::LoopCall(user, this, parameters, 0, -1, false)) return CMD_SUCCESS; if (ServerInstance->IsChannel(parameters[0])) diff --git a/src/commands/cmd_kick.cpp b/src/commands/cmd_kick.cpp index 016a14b2e..825cfebcb 100644 --- a/src/commands/cmd_kick.cpp +++ b/src/commands/cmd_kick.cpp @@ -48,7 +48,7 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User Channel* c = ServerInstance->FindChan(parameters[0]); User* u; - if (ServerInstance->Parser->LoopCall(user, this, parameters, 1)) + if (CommandParser::LoopCall(user, this, parameters, 1)) return CMD_SUCCESS; if (IS_LOCAL(user)) diff --git a/src/commands/cmd_kill.cpp b/src/commands/cmd_kill.cpp index 6bf657115..04a59f60a 100644 --- a/src/commands/cmd_kill.cpp +++ b/src/commands/cmd_kill.cpp @@ -57,7 +57,7 @@ class CommandKill : public Command CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User *user) { /* Allow comma seperated lists of users for /KILL (thanks w00t) */ - if (ServerInstance->Parser->LoopCall(user, this, parameters, 0)) + if (CommandParser::LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; User *u = ServerInstance->FindNick(parameters[0]); diff --git a/src/commands/cmd_names.cpp b/src/commands/cmd_names.cpp index 0c06b636f..1f0de91f1 100644 --- a/src/commands/cmd_names.cpp +++ b/src/commands/cmd_names.cpp @@ -52,7 +52,7 @@ CmdResult CommandNames::Handle (const std::vector<std::string>& parameters, User return CMD_SUCCESS; } - if (ServerInstance->Parser->LoopCall(user, this, parameters, 0)) + if (CommandParser::LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; c = ServerInstance->FindChan(parameters[0]); diff --git a/src/commands/cmd_part.cpp b/src/commands/cmd_part.cpp index aadb42d90..9b8d1d717 100644 --- a/src/commands/cmd_part.cpp +++ b/src/commands/cmd_part.cpp @@ -57,7 +57,7 @@ CmdResult CommandPart::Handle (const std::vector<std::string>& parameters, User reason = parameters[1]; } - if (ServerInstance->Parser->LoopCall(user, this, parameters, 0)) + if (CommandParser::LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; Channel* c = ServerInstance->FindChan(parameters[0]); diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp index eb9468bb9..7de3bf924 100644 --- a/src/commands/cmd_privmsg.cpp +++ b/src/commands/cmd_privmsg.cpp @@ -62,7 +62,7 @@ CmdResult MessageCommandBase::HandleMessage(const std::vector<std::string>& para if (localuser) localuser->idle_lastmsg = ServerInstance->Time(); - if (ServerInstance->Parser->LoopCall(user, this, parameters, 0)) + if (CommandParser::LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; if (parameters[0][0] == '$') diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp index de3d71152..9048184f6 100644 --- a/src/commands/cmd_whois.cpp +++ b/src/commands/cmd_whois.cpp @@ -195,7 +195,7 @@ CmdResult CommandWhois::HandleLocal(const std::vector<std::string>& parameters, int userindex = 0; unsigned long idle = 0, signon = 0; - if (ServerInstance->Parser->LoopCall(user, this, parameters, 0)) + if (CommandParser::LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; /* |