diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-11-12 00:28:05 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-11-12 00:28:05 +0000 |
commit | 848c0aaa212f6e5e69a30d14e36772ffd2d421c7 (patch) | |
tree | c1fee3ebba7cfe38ca42b2afb199339f94631d2a /src/core/bs_bot.c | |
parent | d16f4930f462386a5ad5507e56c07ac6610ac2bb (diff) |
Made Command::Execute's params const
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2644 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core/bs_bot.c')
-rw-r--r-- | src/core/bs_bot.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c index 955f4e42c..cba750cbe 100644 --- a/src/core/bs_bot.c +++ b/src/core/bs_bot.c @@ -18,7 +18,7 @@ class CommandBSBot : public Command { private: - CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[1].c_str(); const char *user = params[2].c_str(); @@ -117,7 +117,7 @@ class CommandBSBot : public Command return MOD_CONT; } - CommandReturn DoChange(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoChange(User *u, const std::vector<ci::string> ¶ms) { const char *oldnick = params[1].c_str(); const char *nick = params.size() > 2 ? params[2].c_str() : NULL; @@ -297,7 +297,7 @@ class CommandBSBot : public Command return MOD_CONT; } - CommandReturn DoDel(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoDel(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[1].c_str(); BotInfo *bi; @@ -335,7 +335,7 @@ class CommandBSBot : public Command this->SetFlag(CFLAG_STRIP_CHANNEL); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; @@ -360,11 +360,12 @@ class CommandBSBot : public Command return MOD_CONT; } + std::vector<ci::string> tempparams = params; // ADD takes less params than CHANGE, so we need to take 6 if given and append it with a space to 5. - if (params.size() >= 6) - params[4] = params[4] + " " + params[5]; + if (tempparams.size() >= 6) + tempparams[4] = tempparams[4] + " " + tempparams[5]; - return this->DoAdd(u, params); + return this->DoAdd(u, tempparams); } else if (cmd == "CHANGE") { |