From cfa32a6561e0152ebbd7135eaec9f7c794c170b1 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 12 Jun 2013 20:32:10 +0200 Subject: 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 --- src/commands/cmd_join.cpp | 4 ++-- src/commands/cmd_kick.cpp | 2 +- src/commands/cmd_kill.cpp | 2 +- src/commands/cmd_names.cpp | 2 +- src/commands/cmd_part.cpp | 2 +- src/commands/cmd_privmsg.cpp | 2 +- src/commands/cmd_whois.cpp | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/commands') 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& 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& 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& 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& 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& 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& 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& 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& 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; /* -- cgit v1.2.3