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 | |
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
114 files changed, 253 insertions, 259 deletions
diff --git a/include/modules.h b/include/modules.h index 8543b0199..87b50a541 100644 --- a/include/modules.h +++ b/include/modules.h @@ -249,7 +249,7 @@ class CoreExport Command : public Flags<CommandFlag> /** Execute this command. * @param u The user executing the command. */ - virtual CommandReturn Execute(User *u, std::vector<ci::string> &); + virtual CommandReturn Execute(User *u, const std::vector<ci::string> &); /** Requested when the user is requesting help on this command. Help on this command should be sent to the user. * @param u The user requesting help diff --git a/src/command.cpp b/src/command.cpp index 89318776b..43c76ac52 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -29,7 +29,7 @@ Command::~Command() } } -CommandReturn Command::Execute(User *u, std::vector<ci::string> &) { return MOD_CONT; } +CommandReturn Command::Execute(User *u, const std::vector<ci::string> &) { return MOD_CONT; } bool Command::OnHelp(User *u, const ci::string &subcommand) { return false; } diff --git a/src/core/bs_act.c b/src/core/bs_act.c index 0fea7e929..c30c8f62d 100644 --- a/src/core/bs_act.c +++ b/src/core/bs_act.c @@ -22,9 +22,10 @@ class CommandBSAct : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelInfo *ci = cs_findchan(params[0].c_str()); + ci::string message = params[1]; if (!check_access(u, ci, CA_SAY)) { @@ -45,13 +46,13 @@ class CommandBSAct : public Command } size_t i = 0; - while ((i = params[1].find_first_of("\001"), i) && i != std::string::npos) - params[1].erase(i, 1); + while ((i = message.find_first_of("\001"), i) && i != std::string::npos) + message.erase(i, 1); - ircdproto->SendAction(ci->bi, ci->name, "%s", params[1].c_str()); + ircdproto->SendAction(ci->bi, ci->name, "%s", message.c_str()); ci->bi->lastmsg = time(NULL); if (LogBot && LogChannel && LogChan && !debug && findchan(LogChannel)) - ircdproto->SendPrivmsg(ci->bi, LogChannel, "ACT %s %s %s", u->nick, ci->name, params[1].c_str()); + ircdproto->SendPrivmsg(ci->bi, LogChannel, "ACT %s %s %s", u->nick, ci->name, message.c_str()); return MOD_CONT; } diff --git a/src/core/bs_assign.c b/src/core/bs_assign.c index 82542580e..10d224b8e 100644 --- a/src/core/bs_assign.c +++ b/src/core/bs_assign.c @@ -22,7 +22,7 @@ class CommandBSAssign : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); const char *nick = params[1].c_str(); diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c index fc9c10bcd..3041ced7b 100644 --- a/src/core/bs_badwords.c +++ b/src/core/bs_badwords.c @@ -234,7 +234,7 @@ class CommandBSBadwords : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ci::string cmd = params[1]; 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") { diff --git a/src/core/bs_botlist.c b/src/core/bs_botlist.c index 9c3e27060..85ed84e17 100644 --- a/src/core/bs_botlist.c +++ b/src/core/bs_botlist.c @@ -22,7 +22,7 @@ class CommandBSBotList : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { int i, count = 0; BotInfo *bi; diff --git a/src/core/bs_help.c b/src/core/bs_help.c index 05fbc9f8d..dcf01009c 100644 --- a/src/core/bs_help.c +++ b/src/core/bs_help.c @@ -24,7 +24,7 @@ class CommandBSHelp : 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) { mod_help_cmd(s_BotServ, u, BOTSERV, params[0].c_str()); return MOD_CONT; diff --git a/src/core/bs_info.c b/src/core/bs_info.c index 86daebbd2..82755fe32 100644 --- a/src/core/bs_info.c +++ b/src/core/bs_info.c @@ -52,7 +52,7 @@ class CommandBSInfo : 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) { BotInfo *bi; ChannelInfo *ci; diff --git a/src/core/bs_kick.c b/src/core/bs_kick.c index 7f9ee8b7b..97e36005a 100644 --- a/src/core/bs_kick.c +++ b/src/core/bs_kick.c @@ -24,7 +24,7 @@ class CommandBSKick : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ci::string option = params[1]; diff --git a/src/core/bs_say.c b/src/core/bs_say.c index 2a1752c05..b96ae194d 100644 --- a/src/core/bs_say.c +++ b/src/core/bs_say.c @@ -22,7 +22,7 @@ class CommandBSSay : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelInfo *ci; diff --git a/src/core/bs_set.c b/src/core/bs_set.c index 34dbda165..10375fc94 100644 --- a/src/core/bs_set.c +++ b/src/core/bs_set.c @@ -23,7 +23,7 @@ class CommandBSSet : 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) { const char *chan = params[0].c_str(); ci::string option = params[1]; diff --git a/src/core/bs_unassign.c b/src/core/bs_unassign.c index 605bc3c37..bf4b01654 100644 --- a/src/core/bs_unassign.c +++ b/src/core/bs_unassign.c @@ -22,7 +22,7 @@ class CommandBSUnassign : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ChannelInfo *ci = cs_findchan(chan); diff --git a/src/core/cs_access.c b/src/core/cs_access.c index 62ac477a2..00af72a88 100644 --- a/src/core/cs_access.c +++ b/src/core/cs_access.c @@ -133,7 +133,7 @@ class CommandCSAccess : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ci::string cmd = params[1]; @@ -429,7 +429,7 @@ class CommandCSLevels : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ci::string cmd = params[1]; diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c index 8d2faffa5..2753b947f 100644 --- a/src/core/cs_akick.c +++ b/src/core/cs_akick.c @@ -139,7 +139,7 @@ int get_access_nc(NickCore *nc, ChannelInfo *ci) class CommandCSAKick : public Command { - void DoAdd(User *u, ChannelInfo *ci, std::vector<ci::string> ¶ms) + void DoAdd(User *u, ChannelInfo *ci, const std::vector<ci::string> ¶ms) { ci::string mask = params[2]; ci::string reason = params.size() > 3 ? params[3] : ""; @@ -263,7 +263,7 @@ class CommandCSAKick : public Command this->DoEnforce(u, ci, params); } - void DoStick(User *u, ChannelInfo *ci, std::vector<ci::string> ¶ms) + void DoStick(User *u, ChannelInfo *ci, const std::vector<ci::string> ¶ms) { NickAlias *na; NickCore *nc; @@ -303,7 +303,7 @@ class CommandCSAKick : public Command stick_mask(ci, akick); } - void DoUnStick(User *u, ChannelInfo *ci, std::vector<ci::string> ¶ms) + void DoUnStick(User *u, ChannelInfo *ci, const std::vector<ci::string> ¶ms) { NickAlias *na; NickCore *nc; @@ -340,7 +340,7 @@ class CommandCSAKick : public Command notice_lang(s_ChanServ, u, CHAN_AKICK_UNSTUCK, akick->mask.c_str(), ci->name); } - void DoDel(User *u, ChannelInfo *ci, std::vector<ci::string> ¶ms) + void DoDel(User *u, ChannelInfo *ci, const std::vector<ci::string> ¶ms) { ci::string mask = params[2]; AutoKick *akick; @@ -400,7 +400,7 @@ class CommandCSAKick : public Command } } - void DoList(User *u, ChannelInfo *ci, std::vector<ci::string> ¶ms) + void DoList(User *u, ChannelInfo *ci, const std::vector<ci::string> ¶ms) { int sent_header = 0; ci::string mask = params.size() > 2 ? params[2] : ""; @@ -439,7 +439,7 @@ class CommandCSAKick : public Command } - void DoView(User *u, ChannelInfo *ci, std::vector<ci::string> ¶ms) + void DoView(User *u, ChannelInfo *ci, const std::vector<ci::string> ¶ms) { int sent_header = 0; ci::string mask = params.size() > 2 ? params[2] : ""; @@ -477,7 +477,7 @@ class CommandCSAKick : public Command } - void DoEnforce(User *u, ChannelInfo *ci, std::vector<ci::string> ¶ms) + void DoEnforce(User *u, ChannelInfo *ci, const std::vector<ci::string> ¶ms) { Channel *c = ci->c; c_userlist *cu, *unext; @@ -514,7 +514,7 @@ class CommandCSAKick : public Command notice_lang(s_ChanServ, u, CHAN_AKICK_ENFORCE_DONE, ci->name, count); } - void DoClear(User *u, ChannelInfo *ci, std::vector<ci::string> ¶ms) + void DoClear(User *u, ChannelInfo *ci, const std::vector<ci::string> ¶ms) { ci->ClearAkick(); notice_lang(s_ChanServ, u, CHAN_AKICK_CLEAR, ci->name); @@ -525,7 +525,7 @@ class CommandCSAKick : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string chan = params[0]; ci::string cmd = params[1]; diff --git a/src/core/cs_ban.c b/src/core/cs_ban.c index 560563ce8..e8a49407c 100644 --- a/src/core/cs_ban.c +++ b/src/core/cs_ban.c @@ -22,7 +22,7 @@ class CommandCSBan : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); const char *target = params[1].c_str(); @@ -30,7 +30,6 @@ class CommandCSBan : public Command if (params.size() > 2) { - params[2].resize(200); reason = params[2].c_str(); } @@ -120,7 +119,7 @@ class CommandCSUnban : public Command } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); Channel *c; diff --git a/src/core/cs_clear.c b/src/core/cs_clear.c index e59e4ab4e..b89c68a8b 100644 --- a/src/core/cs_clear.c +++ b/src/core/cs_clear.c @@ -23,7 +23,7 @@ class CommandCSClear : public Command } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ci::string what = params[1]; diff --git a/src/core/cs_drop.c b/src/core/cs_drop.c index 8363b9400..0198ea220 100644 --- a/src/core/cs_drop.c +++ b/src/core/cs_drop.c @@ -24,7 +24,7 @@ class CommandCSDrop : public Command this->SetFlag(CFLAG_ALLOW_SUSPENDED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ChannelInfo *ci; diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c index 5ca5b395c..c0b4df8c5 100644 --- a/src/core/cs_forbid.c +++ b/src/core/cs_forbid.c @@ -23,7 +23,7 @@ class CommandCSForbid : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelInfo *ci; const char *chan = params[0].c_str(); diff --git a/src/core/cs_getkey.c b/src/core/cs_getkey.c index 387769aee..b24dd4fcb 100644 --- a/src/core/cs_getkey.c +++ b/src/core/cs_getkey.c @@ -22,7 +22,7 @@ class CommandCSGetKey : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ChannelInfo *ci; diff --git a/src/core/cs_help.c b/src/core/cs_help.c index e610e0634..c18f6215b 100644 --- a/src/core/cs_help.c +++ b/src/core/cs_help.c @@ -24,7 +24,7 @@ class CommandCSHelp : 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]; diff --git a/src/core/cs_info.c b/src/core/cs_info.c index a52e411f2..1aed40e0a 100644 --- a/src/core/cs_info.c +++ b/src/core/cs_info.c @@ -37,7 +37,7 @@ class CommandCSInfo : public Command this->SetFlag(CFLAG_ALLOW_FORBIDDEN); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ci::string param = params.size() > 1 ? params[1] : ""; diff --git a/src/core/cs_invite.c b/src/core/cs_invite.c index d73d7693f..c8b0dde50 100644 --- a/src/core/cs_invite.c +++ b/src/core/cs_invite.c @@ -22,7 +22,7 @@ class CommandCSInvite : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); Channel *c; diff --git a/src/core/cs_kick.c b/src/core/cs_kick.c index 7d2a9f880..17c35ab6c 100644 --- a/src/core/cs_kick.c +++ b/src/core/cs_kick.c @@ -22,7 +22,7 @@ class CommandCSKick : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); const char *target = params[1].c_str(); @@ -30,7 +30,6 @@ class CommandCSKick : public Command if (params.size() > 2) { - params[2].resize(200); reason = params[2].c_str(); } diff --git a/src/core/cs_list.c b/src/core/cs_list.c index 3e05c9ad8..68975cadf 100644 --- a/src/core/cs_list.c +++ b/src/core/cs_list.c @@ -24,7 +24,7 @@ public: this->SetFlag(CFLAG_STRIP_CHANNEL); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *pattern = params[0].c_str(); int spattern_size; diff --git a/src/core/cs_modes.c b/src/core/cs_modes.c index 998b5fdd9..49613e071 100644 --- a/src/core/cs_modes.c +++ b/src/core/cs_modes.c @@ -82,7 +82,7 @@ class CommandCSOp : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_OP); @@ -109,7 +109,7 @@ class CommandCSDeOp : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_OP); @@ -136,7 +136,7 @@ class CommandCSVoice : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_VOICE); @@ -163,7 +163,7 @@ class CommandCSDeVoice : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_VOICE); @@ -190,7 +190,7 @@ class CommandCSHalfOp : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_HALFOP); @@ -222,7 +222,7 @@ class CommandCSDeHalfOp : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_HALFOP); @@ -255,7 +255,7 @@ class CommandCSProtect : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_PROTECT); @@ -286,7 +286,7 @@ class CommandCSDeProtect : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_PROTECT); @@ -317,7 +317,7 @@ class CommandCSOwner : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_OWNER); @@ -348,7 +348,7 @@ class CommandCSDeOwner : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_OWNER); diff --git a/src/core/cs_register.c b/src/core/cs_register.c index 6c274ae04..789949690 100644 --- a/src/core/cs_register.c +++ b/src/core/cs_register.c @@ -23,7 +23,7 @@ class CommandCSRegister : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); const char *desc = params[1].c_str(); diff --git a/src/core/cs_set.c b/src/core/cs_set.c index 270eda891..b70a528f3 100644 --- a/src/core/cs_set.c +++ b/src/core/cs_set.c @@ -654,7 +654,7 @@ class CommandCSSet : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ci::string cmd = params[1]; diff --git a/src/core/cs_status.c b/src/core/cs_status.c index 71c998dc1..7ec6a820b 100644 --- a/src/core/cs_status.c +++ b/src/core/cs_status.c @@ -22,7 +22,7 @@ class CommandCSStatus : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ChannelInfo *ci; User *u2; diff --git a/src/core/cs_suspend.c b/src/core/cs_suspend.c index af8edfe35..189588736 100644 --- a/src/core/cs_suspend.c +++ b/src/core/cs_suspend.c @@ -22,7 +22,7 @@ class CommandCSSuspend : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); const char *reason = params.size() > 1 ? params[1].c_str() : NULL; @@ -116,7 +116,7 @@ class CommandCSUnSuspend : public Command this->SetFlag(CFLAG_ALLOW_SUSPENDED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ChannelInfo *ci = cs_findchan(chan); diff --git a/src/core/cs_topic.c b/src/core/cs_topic.c index 9d461b69a..37ab6d078 100644 --- a/src/core/cs_topic.c +++ b/src/core/cs_topic.c @@ -22,7 +22,7 @@ class CommandCSTopic : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); const char *topic = params.size() > 1 ? params[1].c_str() : NULL; diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c index 81dd80224..9d489d555 100644 --- a/src/core/cs_xop.c +++ b/src/core/cs_xop.c @@ -118,7 +118,7 @@ int xop_msgs[XOP_TYPES][XOP_MESSAGES] = { class XOPBase : public Command { private: - CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms, ChannelInfo *ci, int level, int *messages) + CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms, ChannelInfo *ci, int level, int *messages) { const char *nick = params.size() > 2 ? params[2].c_str() : NULL; ChanAccess *access; @@ -205,7 +205,7 @@ class XOPBase : public Command return MOD_CONT; } - CommandReturn DoDel(User *u, std::vector<ci::string> ¶ms, ChannelInfo *ci, int level, int *messages) + CommandReturn DoDel(User *u, const std::vector<ci::string> ¶ms, ChannelInfo *ci, int level, int *messages) { const char *nick = params.size() > 2 ? params[2].c_str() : NULL; ChanAccess *access; @@ -304,7 +304,7 @@ class XOPBase : public Command return MOD_CONT; } - CommandReturn DoList(User *u, std::vector<ci::string> ¶ms, ChannelInfo *ci, int level, int *messages) + CommandReturn DoList(User *u, const std::vector<ci::string> ¶ms, ChannelInfo *ci, int level, int *messages) { int sent_header = 0; const char *nick = params.size() > 2 ? params[2].c_str() : NULL; @@ -339,7 +339,7 @@ class XOPBase : public Command return MOD_CONT; } - CommandReturn DoClear(User *u, std::vector<ci::string> ¶ms, ChannelInfo *ci, int level, int *messages) + CommandReturn DoClear(User *u, const std::vector<ci::string> ¶ms, ChannelInfo *ci, int level, int *messages) { if (readonly) { @@ -373,7 +373,7 @@ class XOPBase : public Command return MOD_CONT; } protected: - CommandReturn DoXop(User *u, std::vector<ci::string> ¶ms, int level, int *messages) + CommandReturn DoXop(User *u, const std::vector<ci::string> ¶ms, int level, int *messages) { const char *chan = params[0].c_str(); ci::string cmd = params[1]; @@ -403,7 +403,7 @@ class XOPBase : public Command { } - virtual CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) = 0; + virtual CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) = 0; virtual bool OnHelp(User *u, const ci::string &subcommand) = 0; @@ -417,7 +417,7 @@ class CommandCSQOP : public XOPBase { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { return this->DoXop(u, params, ACCESS_QOP, xop_msgs[XOP_QOP]); } @@ -441,7 +441,7 @@ class CommandCSAOP : public XOPBase { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { return this->DoXop(u, params, ACCESS_AOP, xop_msgs[XOP_AOP]); } @@ -465,7 +465,7 @@ class CommandCSHOP : public XOPBase { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { return this->DoXop(u, params, ACCESS_HOP, xop_msgs[XOP_HOP]); } @@ -489,7 +489,7 @@ class CommandCSSOP : public XOPBase { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { return this->DoXop(u, params, ACCESS_SOP, xop_msgs[XOP_SOP]); } @@ -513,7 +513,7 @@ class CommandCSVOP : public XOPBase { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { return this->DoXop(u, params, ACCESS_VOP, xop_msgs[XOP_VOP]); } diff --git a/src/core/hs_del.c b/src/core/hs_del.c index 48187cbb9..366bfc69c 100644 --- a/src/core/hs_del.c +++ b/src/core/hs_del.c @@ -22,7 +22,7 @@ class CommandHSDel : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { NickAlias *na; const char *nick = params[0].c_str(); diff --git a/src/core/hs_delall.c b/src/core/hs_delall.c index e1cc2cb94..ab7f5c352 100644 --- a/src/core/hs_delall.c +++ b/src/core/hs_delall.c @@ -22,7 +22,7 @@ class CommandHSDelAll : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { int i; const char *nick = params[0].c_str(); diff --git a/src/core/hs_group.c b/src/core/hs_group.c index f50e06f9d..87cfe9a43 100644 --- a/src/core/hs_group.c +++ b/src/core/hs_group.c @@ -24,7 +24,7 @@ class CommandHSGroup : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { HostCore *tmp; char *vHost = NULL; diff --git a/src/core/hs_help.c b/src/core/hs_help.c index 24d3946c8..aa33e217b 100644 --- a/src/core/hs_help.c +++ b/src/core/hs_help.c @@ -23,7 +23,7 @@ class CommandHSHelp : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { mod_help_cmd(s_HostServ, u, HOSTSERV, params[0].c_str()); return MOD_CONT; diff --git a/src/core/hs_list.c b/src/core/hs_list.c index 5c1dd136b..99b6f9337 100644 --- a/src/core/hs_list.c +++ b/src/core/hs_list.c @@ -22,7 +22,7 @@ class CommandHSList : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *key = params.size() ? params[0].c_str() : NULL; struct tm *tm; diff --git a/src/core/hs_off.c b/src/core/hs_off.c index b30d85250..631853a4b 100644 --- a/src/core/hs_off.c +++ b/src/core/hs_off.c @@ -22,7 +22,7 @@ class CommandHSOff : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { char *vhost; char *vident = NULL; diff --git a/src/core/hs_on.c b/src/core/hs_on.c index 7308f4c32..89752aa03 100644 --- a/src/core/hs_on.c +++ b/src/core/hs_on.c @@ -22,7 +22,7 @@ class CommandHSOn : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { char *vHost; char *vIdent = NULL; diff --git a/src/core/hs_set.c b/src/core/hs_set.c index c9b1857f5..0159d8e07 100644 --- a/src/core/hs_set.c +++ b/src/core/hs_set.c @@ -22,7 +22,7 @@ class CommandHSSet : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); const char *rawhostmask = params[1].c_str(); diff --git a/src/core/hs_setall.c b/src/core/hs_setall.c index e0eed6406..a018814e2 100644 --- a/src/core/hs_setall.c +++ b/src/core/hs_setall.c @@ -24,7 +24,7 @@ class CommandHSSetAll : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); const char *rawhostmask = params[1].c_str(); diff --git a/src/core/ms_cancel.c b/src/core/ms_cancel.c index 2277a7e8e..ca6019f39 100644 --- a/src/core/ms_cancel.c +++ b/src/core/ms_cancel.c @@ -24,7 +24,7 @@ class CommandMSCancel : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { int ischan; int isforbid; diff --git a/src/core/ms_check.c b/src/core/ms_check.c index f297b3cbf..b4c5481f5 100644 --- a/src/core/ms_check.c +++ b/src/core/ms_check.c @@ -22,7 +22,7 @@ class CommandMSCheck : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { NickAlias *na = NULL; MemoInfo *mi = NULL; diff --git a/src/core/ms_del.c b/src/core/ms_del.c index 405db50cf..bdd3f2eff 100644 --- a/src/core/ms_del.c +++ b/src/core/ms_del.c @@ -24,7 +24,7 @@ class CommandMSDel : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { MemoInfo *mi; ChannelInfo *ci; diff --git a/src/core/ms_help.c b/src/core/ms_help.c index d19daa3b0..ae26da622 100644 --- a/src/core/ms_help.c +++ b/src/core/ms_help.c @@ -23,7 +23,7 @@ class CommandMSHelp : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { mod_help_cmd(s_MemoServ, u, MEMOSERV, params[0].c_str()); return MOD_CONT; diff --git a/src/core/ms_info.c b/src/core/ms_info.c index 1a2d0289b..d78272f3f 100644 --- a/src/core/ms_info.c +++ b/src/core/ms_info.c @@ -22,7 +22,7 @@ class CommandMSInfo : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { MemoInfo *mi; NickAlias *na = NULL; diff --git a/src/core/ms_list.c b/src/core/ms_list.c index 51b8182f3..6152ef0e7 100644 --- a/src/core/ms_list.c +++ b/src/core/ms_list.c @@ -25,7 +25,7 @@ class CommandMSList : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string param = params.size() ? params[0] : "", chan; ChannelInfo *ci; diff --git a/src/core/ms_read.c b/src/core/ms_read.c index 7329c0fde..307439d1e 100644 --- a/src/core/ms_read.c +++ b/src/core/ms_read.c @@ -26,7 +26,7 @@ class CommandMSRead : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { MemoInfo *mi; ChannelInfo *ci; diff --git a/src/core/ms_rsend.c b/src/core/ms_rsend.c index eeb39de6a..f17f17c2e 100644 --- a/src/core/ms_rsend.c +++ b/src/core/ms_rsend.c @@ -22,7 +22,7 @@ class CommandMSRSend : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); const char *text = params[1].c_str(); diff --git a/src/core/ms_send.c b/src/core/ms_send.c index 7db68a03f..62429eac8 100644 --- a/src/core/ms_send.c +++ b/src/core/ms_send.c @@ -22,7 +22,7 @@ class CommandMSSend : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); const char *text = params[1].c_str(); diff --git a/src/core/ms_sendall.c b/src/core/ms_sendall.c index 180bbf869..c594be03f 100644 --- a/src/core/ms_sendall.c +++ b/src/core/ms_sendall.c @@ -22,7 +22,7 @@ class CommandMSSendAll : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { int i, z = 1; NickCore *nc; diff --git a/src/core/ms_set.c b/src/core/ms_set.c index b8d08d6dd..3a7c396bf 100644 --- a/src/core/ms_set.c +++ b/src/core/ms_set.c @@ -18,7 +18,7 @@ class CommandMSSet : public Command { private: - CommandReturn DoNotify(User *u, std::vector<ci::string> ¶ms, MemoInfo *mi) + CommandReturn DoNotify(User *u, const std::vector<ci::string> ¶ms, MemoInfo *mi) { ci::string param = params[1]; @@ -67,7 +67,7 @@ class CommandMSSet : public Command return MOD_CONT; } - CommandReturn DoLimit(User *u, std::vector<ci::string> ¶ms, MemoInfo *mi) + CommandReturn DoLimit(User *u, const std::vector<ci::string> ¶ms, MemoInfo *mi) { ci::string p1 = params[1]; ci::string p2 = params.size() > 2 ? params[2] : ""; @@ -207,7 +207,7 @@ class CommandMSSet : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; MemoInfo *mi = &u->nc->memos; diff --git a/src/core/ms_staff.c b/src/core/ms_staff.c index ab08cb3ca..520c14df0 100644 --- a/src/core/ms_staff.c +++ b/src/core/ms_staff.c @@ -22,7 +22,7 @@ class CommandMSStaff : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { NickCore *nc; int i, z = 0; diff --git a/src/core/ns_access.c b/src/core/ns_access.c index e6a0b12b3..8aa40d546 100644 --- a/src/core/ns_access.c +++ b/src/core/ns_access.c @@ -18,7 +18,7 @@ class CommandNSAccess : public Command { private: - CommandReturn DoServAdminList(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoServAdminList(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *mask = params.size() > 2 ? params[2].c_str() : NULL; unsigned i; @@ -127,7 +127,7 @@ class CommandNSAccess : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; const char *mask = params.size() > 1 ? params[1].c_str() : NULL; diff --git a/src/core/ns_alist.c b/src/core/ns_alist.c index 2c0c72b12..6ecc3201f 100644 --- a/src/core/ns_alist.c +++ b/src/core/ns_alist.c @@ -22,7 +22,7 @@ class CommandNSAList : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { /* * List the channels that the given nickname has access on diff --git a/src/core/ns_drop.c b/src/core/ns_drop.c index 430c57d03..275820826 100644 --- a/src/core/ns_drop.c +++ b/src/core/ns_drop.c @@ -22,7 +22,7 @@ class CommandNSDrop : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params.size() ? params[0].c_str() : NULL; NickAlias *na; diff --git a/src/core/ns_forbid.c b/src/core/ns_forbid.c index c76f2a67c..16f3bda6f 100644 --- a/src/core/ns_forbid.c +++ b/src/core/ns_forbid.c @@ -22,7 +22,7 @@ class CommandNSForbid : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { NickAlias *na; const char *nick = params[0].c_str(); diff --git a/src/core/ns_getemail.c b/src/core/ns_getemail.c index 91fb28331..1c1ea750a 100644 --- a/src/core/ns_getemail.c +++ b/src/core/ns_getemail.c @@ -27,7 +27,7 @@ class CommandNSGetEMail : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string email = params[0]; int i, j = 0; diff --git a/src/core/ns_getpass.c b/src/core/ns_getpass.c index 9dcf0d3d5..4baa1224e 100644 --- a/src/core/ns_getpass.c +++ b/src/core/ns_getpass.c @@ -22,7 +22,7 @@ class CommandNSGetPass : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); char tmp_pass[PASSMAX]; diff --git a/src/core/ns_ghost.c b/src/core/ns_ghost.c index 3e867511f..a7e81c334 100644 --- a/src/core/ns_ghost.c +++ b/src/core/ns_ghost.c @@ -23,7 +23,7 @@ class CommandNSGhost : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); const char *pass = params.size() > 1 ? params[1].c_str() : NULL; diff --git a/src/core/ns_group.c b/src/core/ns_group.c index 3961f1dd1..e66986ce6 100644 --- a/src/core/ns_group.c +++ b/src/core/ns_group.c @@ -23,7 +23,7 @@ class CommandNSGroup : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { NickAlias *na, *target; const char *nick = params[0].c_str(); @@ -156,7 +156,7 @@ class CommandNSGList : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params.size() ? params[0].c_str() : NULL; diff --git a/src/core/ns_help.c b/src/core/ns_help.c index 6a4f630b0..9b1bdfe5c 100644 --- a/src/core/ns_help.c +++ b/src/core/ns_help.c @@ -23,7 +23,7 @@ class CommandNSHelp : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; diff --git a/src/core/ns_identify.c b/src/core/ns_identify.c index 6f18a39c9..0d262d54b 100644 --- a/src/core/ns_identify.c +++ b/src/core/ns_identify.c @@ -26,7 +26,7 @@ class CommandNSIdentify : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *pass = params[0].c_str(); NickAlias *na; diff --git a/src/core/ns_info.c b/src/core/ns_info.c index 104cad7b6..b2288f9fe 100644 --- a/src/core/ns_info.c +++ b/src/core/ns_info.c @@ -36,7 +36,7 @@ class CommandNSInfo : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { /* Show hidden info to nick owners and sadmins when the "ALL" parameter is * supplied. If a nick is online, the "Last seen address" changes to "Is diff --git a/src/core/ns_list.c b/src/core/ns_list.c index a394c0b1e..891c620d4 100644 --- a/src/core/ns_list.c +++ b/src/core/ns_list.c @@ -23,7 +23,7 @@ class CommandNSList : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { /* SADMINS can search for nicks based on their NS_FORBIDDEN and NS_NO_EXPIRE * status. The keywords FORBIDDEN and NOEXPIRE represent these two states diff --git a/src/core/ns_logout.c b/src/core/ns_logout.c index 90bf4d7de..c928b96ce 100644 --- a/src/core/ns_logout.c +++ b/src/core/ns_logout.c @@ -25,7 +25,7 @@ class CommandNSLogout : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params.size() ? params[0].c_str() : NULL; ci::string param = params.size() > 1 ? params[1] : ""; diff --git a/src/core/ns_recover.c b/src/core/ns_recover.c index 7819752e0..98ec3d926 100644 --- a/src/core/ns_recover.c +++ b/src/core/ns_recover.c @@ -23,7 +23,7 @@ class CommandNSRecover : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); const char *pass = params.size() > 1 ? params[1].c_str() : NULL; diff --git a/src/core/ns_register.c b/src/core/ns_register.c index 669f7b573..903332b34 100644 --- a/src/core/ns_register.c +++ b/src/core/ns_register.c @@ -94,7 +94,7 @@ class CommandNSConfirm : public Command } - CommandReturn DoConfirm(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoConfirm(User *u, const std::vector<ci::string> ¶ms) { NickRequest *nr = NULL; const char *passcode = params.size() ? params[0].c_str() : NULL; @@ -149,7 +149,7 @@ class CommandNSConfirm : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { return this->DoConfirm(u, params); } @@ -171,7 +171,7 @@ class CommandNSRegister : public CommandNSConfirm this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { NickRequest *nr = NULL, *anr = NULL; NickAlias *na; @@ -321,7 +321,7 @@ class CommandNSResend : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { NickRequest *nr = NULL; if (NSEmailReg) diff --git a/src/core/ns_release.c b/src/core/ns_release.c index a5fc3447a..fa3b23496 100644 --- a/src/core/ns_release.c +++ b/src/core/ns_release.c @@ -23,7 +23,7 @@ class CommandNSRelease : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); const char *pass = params.size() > 1 ? params[1].c_str() : NULL; diff --git a/src/core/ns_saset.c b/src/core/ns_saset.c index dac66acee..f6ee6ad32 100644 --- a/src/core/ns_saset.c +++ b/src/core/ns_saset.c @@ -18,7 +18,7 @@ class CommandNSSASet : public Command { private: - CommandReturn DoSetDisplay(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetDisplay(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 2 ? params[2] : ""; int i; @@ -52,7 +52,7 @@ private: return MOD_CONT; } - CommandReturn DoSetPassword(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetPassword(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 2 ? params[2] : ""; @@ -83,12 +83,10 @@ private: if (enc_encrypt(param.c_str(), len, nc->pass, PASSMAX - 1) < 0) { - params[2].clear(); alog("%s: Failed to encrypt password for %s (set)", s_NickServ, nc->display); notice_lang(s_NickServ, u, NICK_SASET_PASSWORD_FAILED, nc->display); return MOD_CONT; } - params[2].clear(); if (enc_decrypt(nc->pass, tmp_pass, PASSMAX - 1) == 1) notice_lang(s_NickServ, u, NICK_SASET_PASSWORD_CHANGED_TO, nc->display, tmp_pass); @@ -101,7 +99,7 @@ private: return MOD_CONT; } - CommandReturn DoSetUrl(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetUrl(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *param = params.size() > 2 ? params[2].c_str() : NULL; @@ -121,7 +119,7 @@ private: return MOD_CONT; } - CommandReturn DoSetEmail(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetEmail(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *param = params.size() > 2 ? params[2].c_str() : NULL; @@ -159,7 +157,7 @@ private: return MOD_CONT; } - CommandReturn DoSetICQ(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetICQ(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *param = params.size() > 2 ? params[2].c_str() : NULL; @@ -182,7 +180,7 @@ private: return MOD_CONT; } - CommandReturn DoSetGreet(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetGreet(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *param = params.size() > 2 ? params[2].c_str() : NULL; @@ -207,7 +205,7 @@ private: return MOD_CONT; } - CommandReturn DoSetKill(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetKill(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 2 ? params[2] : ""; @@ -255,7 +253,7 @@ private: return MOD_CONT; } - CommandReturn DoSetSecure(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetSecure(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 2 ? params[2] : ""; @@ -280,7 +278,7 @@ private: return MOD_CONT; } - CommandReturn DoSetPrivate(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetPrivate(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 2 ? params[2] : ""; @@ -305,7 +303,7 @@ private: return MOD_CONT; } - CommandReturn DoSetMsg(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetMsg(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 2 ? params[2] : ""; @@ -336,7 +334,7 @@ private: return MOD_CONT; } - CommandReturn DoSetHide(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetHide(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 2 ? params[2] : ""; @@ -397,7 +395,7 @@ private: return MOD_CONT; } - CommandReturn DoSetNoExpire(User *u, std::vector<ci::string> ¶ms, NickAlias *na) + CommandReturn DoSetNoExpire(User *u, const std::vector<ci::string> ¶ms, NickAlias *na) { ci::string param = params.size() > 2 ? params[2] : ""; @@ -422,7 +420,7 @@ private: return MOD_CONT; } - CommandReturn DoSetAutoOP(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetAutoOP(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 2 ? params[2] : ""; @@ -448,7 +446,7 @@ private: return MOD_CONT; } - CommandReturn DoSetLanguage(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetLanguage(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *param = params.size() > 2 ? params[2].c_str() : NULL; @@ -481,7 +479,7 @@ public: { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); ci::string cmd = params[1]; diff --git a/src/core/ns_sendpass.c b/src/core/ns_sendpass.c index 7ccd3b081..ee7a1c28d 100644 --- a/src/core/ns_sendpass.c +++ b/src/core/ns_sendpass.c @@ -22,7 +22,7 @@ class CommandNSSendPass : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); NickAlias *na; diff --git a/src/core/ns_set.c b/src/core/ns_set.c index 9b1c14b94..21395b5d5 100644 --- a/src/core/ns_set.c +++ b/src/core/ns_set.c @@ -18,7 +18,7 @@ class CommandNSSet : public Command { private: - CommandReturn DoSetDisplay(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetDisplay(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 1 ? params[1] : ""; @@ -53,7 +53,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetPassword(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetPassword(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 1 ? params[1] : ""; @@ -79,12 +79,10 @@ class CommandNSSet : public Command if (enc_encrypt(param.c_str(), len, nc->pass, PASSMAX - 1) < 0) { - params[1].clear(); alog("%s: Failed to encrypt password for %s (set)", s_NickServ, nc->display); notice_lang(s_NickServ, u, NICK_SET_PASSWORD_FAILED); return MOD_CONT; } - params[1].clear(); if (enc_decrypt(nc->pass, tmp_pass, PASSMAX - 1) == 1) notice_lang(s_NickServ, u, NICK_SET_PASSWORD_CHANGED_TO, tmp_pass); @@ -96,7 +94,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetLanguage(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetLanguage(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *param = params.size() > 1 ? params[1].c_str() : NULL; @@ -124,7 +122,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetUrl(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetUrl(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *param = params.size() > 1 ? params[1].c_str() : NULL; @@ -144,7 +142,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetEmail(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetEmail(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *param = params.size() > 1 ? params[1].c_str() : NULL; @@ -177,7 +175,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetICQ(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetICQ(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *param = params.size() > 1 ? params[1].c_str() : NULL; @@ -200,7 +198,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetGreet(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetGreet(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { const char *param = params.size() > 1 ? params[1].c_str() : NULL; @@ -225,7 +223,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetKill(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetKill(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 1 ? params[1] : ""; @@ -273,7 +271,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetSecure(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetSecure(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 1 ? params[1] : ""; @@ -298,7 +296,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetPrivate(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetPrivate(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 1 ? params[1] : ""; @@ -323,7 +321,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetMsg(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetMsg(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 1 ? params[1] : ""; @@ -354,7 +352,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetHide(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetHide(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 1 ? params[1] : ""; @@ -415,7 +413,7 @@ class CommandNSSet : public Command return MOD_CONT; } - CommandReturn DoSetAutoOP(User *u, std::vector<ci::string> ¶ms, NickCore *nc) + CommandReturn DoSetAutoOP(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 1 ? params[1] : ""; @@ -450,7 +448,7 @@ class CommandNSSet : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; diff --git a/src/core/ns_status.c b/src/core/ns_status.c index 95dd4fe7d..178817eec 100644 --- a/src/core/ns_status.c +++ b/src/core/ns_status.c @@ -23,7 +23,7 @@ class CommandNSStatus : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { User *u2; NickAlias *na = NULL; diff --git a/src/core/ns_suspend.c b/src/core/ns_suspend.c index 595299c7a..fbdce2f97 100644 --- a/src/core/ns_suspend.c +++ b/src/core/ns_suspend.c @@ -22,7 +22,7 @@ class CommandNSSuspend : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { NickAlias *na, *na2; User *u2; @@ -113,7 +113,7 @@ class CommandNSUnSuspend : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { NickAlias *na; const char *nick = params[0].c_str(); diff --git a/src/core/ns_update.c b/src/core/ns_update.c index b84608d08..c1a6d66a5 100644 --- a/src/core/ns_update.c +++ b/src/core/ns_update.c @@ -22,7 +22,7 @@ class CommandNSUpdate : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { NickAlias *na = findnick(u->nick); diff --git a/src/core/os_akill.c b/src/core/os_akill.c index 3101f8300..d7f2cddbd 100644 --- a/src/core/os_akill.c +++ b/src/core/os_akill.c @@ -23,7 +23,7 @@ int akill_list(int number, Akill *ak, User *u, int *sent_header); class CommandOSAKill : public Command { private: - CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms) { int deleted = 0; unsigned last_param = 2; @@ -141,7 +141,7 @@ class CommandOSAKill : 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 *mask; int res = 0; @@ -192,7 +192,7 @@ class CommandOSAKill : public Command return MOD_CONT; } - CommandReturn DoList(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoList(User *u, const std::vector<ci::string> ¶ms) { const char *mask; int res, sent_header = 0; @@ -237,7 +237,7 @@ class CommandOSAKill : public Command return MOD_CONT; } - CommandReturn DoView(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoView(User *u, const std::vector<ci::string> ¶ms) { const char *mask; int res, sent_header = 0; @@ -290,7 +290,7 @@ class CommandOSAKill : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; diff --git a/src/core/os_chankill.c b/src/core/os_chankill.c index 2937e0136..ff0eae474 100644 --- a/src/core/os_chankill.c +++ b/src/core/os_chankill.c @@ -22,7 +22,7 @@ class CommandOSChanKill : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *expiry, *channel; char reason[BUFSIZE], realreason[BUFSIZE]; diff --git a/src/core/os_chanlist.c b/src/core/os_chanlist.c index 4203e53ff..823b3fade 100644 --- a/src/core/os_chanlist.c +++ b/src/core/os_chanlist.c @@ -22,7 +22,7 @@ class CommandOSChanList : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *pattern = params.size() > 0 ? params[0].c_str() : NULL; ci::string opt = params.size() > 1 ? params[1] : ""; diff --git a/src/core/os_clearmodes.c b/src/core/os_clearmodes.c index fb614138b..f7c5d83ec 100644 --- a/src/core/os_clearmodes.c +++ b/src/core/os_clearmodes.c @@ -22,7 +22,7 @@ class CommandOSClearModes : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *argv[2]; const char *chan = params[0].c_str(); diff --git a/src/core/os_defcon.c b/src/core/os_defcon.c index d8119e7c0..fdcecc525 100644 --- a/src/core/os_defcon.c +++ b/src/core/os_defcon.c @@ -62,7 +62,7 @@ class CommandOSDEFCON : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *lvl = params[0].c_str(); int newLevel = 0; diff --git a/src/core/os_global.c b/src/core/os_global.c index 9182e6acd..fe9ccb161 100644 --- a/src/core/os_global.c +++ b/src/core/os_global.c @@ -22,7 +22,7 @@ class CommandOSGlobal : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *msg = params[0].c_str(); diff --git a/src/core/os_help.c b/src/core/os_help.c index 698bdd209..626d5ed5b 100644 --- a/src/core/os_help.c +++ b/src/core/os_help.c @@ -22,7 +22,7 @@ class CommandOSHelp : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { mod_help_cmd(s_OperServ, u, OPERSERV, params[0].c_str()); return MOD_CONT; diff --git a/src/core/os_ignore.c b/src/core/os_ignore.c index 0bb41a79e..da6ef13db 100644 --- a/src/core/os_ignore.c +++ b/src/core/os_ignore.c @@ -18,7 +18,7 @@ class CommandOSIgnore : public Command { private: - CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms) { const char *time = params.size() > 1 ? params[1].c_str() : NULL; const char *nick = params.size() > 2 ? params[2].c_str() : NULL; @@ -70,7 +70,7 @@ class CommandOSIgnore : 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.size() > 1 ? params[1].c_str() : NULL; if (!nick) @@ -100,7 +100,7 @@ class CommandOSIgnore : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; diff --git a/src/core/os_jupe.c b/src/core/os_jupe.c index 4d6706848..31f33d47a 100644 --- a/src/core/os_jupe.c +++ b/src/core/os_jupe.c @@ -22,7 +22,7 @@ class CommandOSJupe : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *jserver = params[0].c_str(); const char *reason = params.size() > 1 ? params[1].c_str() : NULL; diff --git a/src/core/os_kick.c b/src/core/os_kick.c index 63e57c276..52428d66b 100644 --- a/src/core/os_kick.c +++ b/src/core/os_kick.c @@ -22,7 +22,7 @@ class CommandOSKick : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *argv[3]; const char *chan = params[0].c_str(), *nick = params[1].c_str(), *s = params[2].c_str(); diff --git a/src/core/os_mode.c b/src/core/os_mode.c index cf273f616..088657876 100644 --- a/src/core/os_mode.c +++ b/src/core/os_mode.c @@ -22,7 +22,7 @@ class CommandOSMode : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { int ac; const char **av; diff --git a/src/core/os_modinfo.c b/src/core/os_modinfo.c index 1a358fd93..8f5e4cd99 100644 --- a/src/core/os_modinfo.c +++ b/src/core/os_modinfo.c @@ -24,7 +24,7 @@ class CommandOSModInfo : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *file = params[0].c_str(); struct tm tm; diff --git a/src/core/os_modlist.c b/src/core/os_modlist.c index f0fd07029..f2b82b678 100644 --- a/src/core/os_modlist.c +++ b/src/core/os_modlist.c @@ -22,7 +22,7 @@ class CommandOSModList : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { int idx; int count = 0; diff --git a/src/core/os_modload.c b/src/core/os_modload.c index e92d21a10..4e4e6d384 100644 --- a/src/core/os_modload.c +++ b/src/core/os_modload.c @@ -22,7 +22,7 @@ class CommandOSModLoad : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *name = params[0].c_str(); diff --git a/src/core/os_modunload.c b/src/core/os_modunload.c index f694277dd..4d6aeb733 100644 --- a/src/core/os_modunload.c +++ b/src/core/os_modunload.c @@ -22,7 +22,7 @@ class CommandOSModUnLoad : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *name = params[0].c_str(); int status; diff --git a/src/core/os_news.c b/src/core/os_news.c index a0f7da1ea..e06be7223 100644 --- a/src/core/os_news.c +++ b/src/core/os_news.c @@ -299,7 +299,7 @@ class NewsBase : public Command return MOD_CONT; } - CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms, NewsType type, int *msgs) + CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms, NewsType type, int *msgs) { const char *text = params.size() > 1 ? params[1].c_str() : NULL; int n; @@ -323,7 +323,7 @@ class NewsBase : public Command return MOD_CONT; } - CommandReturn DoDel(User *u, std::vector<ci::string> ¶ms, NewsType type, int *msgs) + CommandReturn DoDel(User *u, const std::vector<ci::string> ¶ms, NewsType type, int *msgs) { const char *text = params.size() > 1 ? params[1].c_str() : NULL; unsigned num; @@ -364,7 +364,7 @@ class NewsBase : public Command return MOD_CONT; } - CommandReturn DoNews(User *u, std::vector<ci::string> ¶ms, NewsType type) + CommandReturn DoNews(User *u, const std::vector<ci::string> ¶ms, NewsType type) { ci::string cmd = params[0]; const char *type_name; @@ -397,7 +397,7 @@ class NewsBase : public Command { } - virtual CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) = 0; + virtual CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) = 0; virtual bool OnHelp(User *u, const ci::string &subcommand) = 0; @@ -411,7 +411,7 @@ class CommandOSLogonNews : public NewsBase { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { return this->DoNews(u, params, NEWS_LOGON); } @@ -435,7 +435,7 @@ class CommandOSOperNews : public NewsBase { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { return this->DoNews(u, params, NEWS_OPER); } @@ -459,7 +459,7 @@ class CommandOSRandomNews : public NewsBase { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { return this->DoNews(u, params, NEWS_RANDOM); } diff --git a/src/core/os_noop.c b/src/core/os_noop.c index 9d17547f1..ce0be71cd 100644 --- a/src/core/os_noop.c +++ b/src/core/os_noop.c @@ -22,7 +22,7 @@ class CommandOSNOOP : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; const char *server = params[1].c_str(); diff --git a/src/core/os_oline.c b/src/core/os_oline.c index 84eea8ab0..e97a3818c 100644 --- a/src/core/os_oline.c +++ b/src/core/os_oline.c @@ -22,7 +22,7 @@ class CommandOSOLine : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); const char *flag = params[1].c_str(); diff --git a/src/core/os_quit.c b/src/core/os_quit.c index cd38b4e88..995eab2cd 100644 --- a/src/core/os_quit.c +++ b/src/core/os_quit.c @@ -22,7 +22,7 @@ class CommandOSQuit : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { quitmsg = new char[28 + strlen(u->nick)]; diff --git a/src/core/os_reload.c b/src/core/os_reload.c index b45961718..e241d28a4 100644 --- a/src/core/os_reload.c +++ b/src/core/os_reload.c @@ -22,7 +22,7 @@ class CommandOSReload : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { if (!read_config(1)) { diff --git a/src/core/os_restart.c b/src/core/os_restart.c index 3784a7697..5dfe7d034 100644 --- a/src/core/os_restart.c +++ b/src/core/os_restart.c @@ -22,7 +22,7 @@ class CommandOSRestart : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { quitmsg = new char[31 + strlen(u->nick)]; if (!quitmsg) diff --git a/src/core/os_session.c b/src/core/os_session.c index 46e6bd351..2a1cde0b2 100644 --- a/src/core/os_session.c +++ b/src/core/os_session.c @@ -18,7 +18,7 @@ class CommandOSSession : public Command { private: - CommandReturn DoList(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoList(User *u, const std::vector<ci::string> ¶ms) { Session *session; int mincount, i; @@ -43,7 +43,7 @@ class CommandOSSession : public Command return MOD_CONT; } - CommandReturn DoView(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoView(User *u, const std::vector<ci::string> ¶ms) { const char *param = params[1].c_str(); Session *session = findsession(param); @@ -62,7 +62,7 @@ class CommandOSSession : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; @@ -181,7 +181,7 @@ static int exception_view_callback(User *u, int num, va_list args) class CommandOSException : public Command { private: - CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms) { const char *mask, *expiry, *limitstr; char reason[BUFSIZE]; @@ -255,7 +255,7 @@ class CommandOSException : 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 *mask = params.size() > 1 ? params[1].c_str() : NULL; int i; @@ -314,7 +314,7 @@ class CommandOSException : public Command return MOD_CONT; } - CommandReturn DoMove(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoMove(User *u, const std::vector<ci::string> ¶ms) { Exception *exception; const char *n1str = params.size() > 1 ? params[1].c_str() : NULL; /* From position */ @@ -365,7 +365,7 @@ class CommandOSException : public Command return MOD_CONT; } - CommandReturn DoList(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoList(User *u, const std::vector<ci::string> ¶ms) { int sent_header = 0, i; expire_exceptions(); @@ -387,7 +387,7 @@ class CommandOSException : public Command return MOD_CONT; } - CommandReturn DoView(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoView(User *u, const std::vector<ci::string> ¶ms) { int sent_header = 0, i; expire_exceptions(); @@ -413,7 +413,7 @@ class CommandOSException : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; diff --git a/src/core/os_set.c b/src/core/os_set.c index 6f7f9b03b..eb067a158 100644 --- a/src/core/os_set.c +++ b/src/core/os_set.c @@ -36,7 +36,7 @@ class CommandOSSet : public Command return MOD_CONT; } - CommandReturn DoSetIgnore(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoSetIgnore(User *u, const std::vector<ci::string> ¶ms) { ci::string setting = params.size() > 1 ? params[1] : ""; @@ -62,7 +62,7 @@ class CommandOSSet : public Command return MOD_CONT; } - CommandReturn DoSetReadOnly(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoSetReadOnly(User *u, const std::vector<ci::string> ¶ms) { ci::string setting = params.size() > 1 ? params[1] : ""; @@ -92,7 +92,7 @@ class CommandOSSet : public Command return MOD_CONT; } - CommandReturn DoSetLogChan(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoSetLogChan(User *u, const std::vector<ci::string> ¶ms) { ci::string setting = params.size() > 1 ? params[1] : ""; Channel *c; @@ -134,7 +134,7 @@ class CommandOSSet : public Command return MOD_CONT; } - CommandReturn DoSetSuperAdmin(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoSetSuperAdmin(User *u, const std::vector<ci::string> ¶ms) { ci::string setting = params.size() > 1 ? params[1] : ""; @@ -171,7 +171,7 @@ class CommandOSSet : public Command return MOD_CONT; } - CommandReturn DoSetDebug(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoSetDebug(User *u, const std::vector<ci::string> ¶ms) { ci::string setting = params.size() > 1 ? params[1] : ""; @@ -205,7 +205,7 @@ class CommandOSSet : public Command return MOD_CONT; } - CommandReturn DoSetNoExpire(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoSetNoExpire(User *u, const std::vector<ci::string> ¶ms) { ci::string setting = params.size() > 1 ? params[1] : ""; @@ -237,7 +237,7 @@ class CommandOSSet : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string option = params[0]; diff --git a/src/core/os_sgline.c b/src/core/os_sgline.c index 18b045706..45dd765f0 100644 --- a/src/core/os_sgline.c +++ b/src/core/os_sgline.c @@ -24,7 +24,7 @@ int sgline_list(int number, SXLine *sx, User *u, int *sent_header); class CommandOSSGLine : public Command { private: - CommandReturn OnAdd(User *u, std::vector<ci::string> ¶ms) + CommandReturn OnAdd(User *u, const std::vector<ci::string> ¶ms) { int deleted = 0; unsigned last_param = 2; @@ -142,7 +142,7 @@ class CommandOSSGLine : public Command return MOD_CONT; } - CommandReturn OnDel(User *u, std::vector<ci::string> ¶ms) + CommandReturn OnDel(User *u, const std::vector<ci::string> ¶ms) { const char *mask; int res = 0; @@ -192,7 +192,7 @@ class CommandOSSGLine : public Command return MOD_CONT; } - CommandReturn OnList(User *u, std::vector<ci::string> ¶ms) + CommandReturn OnList(User *u, const std::vector<ci::string> ¶ms) { const char *mask; int res, sent_header = 0; @@ -234,7 +234,7 @@ class CommandOSSGLine : public Command return MOD_CONT; } - CommandReturn OnView(User *u, std::vector<ci::string> ¶ms) + CommandReturn OnView(User *u, const std::vector<ci::string> ¶ms) { const char *mask; int res, sent_header = 0; @@ -287,7 +287,7 @@ class CommandOSSGLine : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; diff --git a/src/core/os_shutdown.c b/src/core/os_shutdown.c index 6c5d97199..a1934ffc9 100644 --- a/src/core/os_shutdown.c +++ b/src/core/os_shutdown.c @@ -22,7 +22,7 @@ class CommandOSShutdown : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { quitmsg = new char[32 + strlen(u->nick)]; diff --git a/src/core/os_sqline.c b/src/core/os_sqline.c index 971cba1b7..f1436d018 100644 --- a/src/core/os_sqline.c +++ b/src/core/os_sqline.c @@ -23,7 +23,7 @@ int sqline_list(int number, SXLine *sx, User *u, int *sent_header); class CommandOSSQLine : public Command { private: - CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms) { int deleted = 0; unsigned last_param = 2; @@ -128,7 +128,7 @@ class CommandOSSQLine : 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 *mask; int res = 0; @@ -178,7 +178,7 @@ class CommandOSSQLine : public Command return MOD_CONT; } - CommandReturn DoList(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoList(User *u, const std::vector<ci::string> ¶ms) { const char *mask; int res, sent_header = 0; @@ -221,7 +221,7 @@ class CommandOSSQLine : public Command return MOD_CONT; } - CommandReturn DoView(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoView(User *u, const std::vector<ci::string> ¶ms) { const char *mask; int res, sent_header = 0; @@ -274,7 +274,7 @@ class CommandOSSQLine : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; diff --git a/src/core/os_staff.c b/src/core/os_staff.c index 682dc93c6..725444521 100644 --- a/src/core/os_staff.c +++ b/src/core/os_staff.c @@ -25,7 +25,7 @@ class CommandOSStaff : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { User *au = NULL; NickCore *nc; diff --git a/src/core/os_stats.c b/src/core/os_stats.c index 3e2cf0472..9e825ee00 100644 --- a/src/core/os_stats.c +++ b/src/core/os_stats.c @@ -271,7 +271,7 @@ class CommandOSStats : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string extra = params.size() ? params[0] : ""; diff --git a/src/core/os_svsnick.c b/src/core/os_svsnick.c index b4ee6090a..090980425 100644 --- a/src/core/os_svsnick.c +++ b/src/core/os_svsnick.c @@ -22,33 +22,31 @@ class CommandOSSVSNick : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); - const char *newnick = params[1].c_str(); + ci::string newnick = params[1]; NickAlias *na; - const char *c; /* Truncate long nicknames to NICKMAX-2 characters */ - if (strlen(newnick) > NICKMAX - 2) + if (newnick.length() > NICKMAX - 2) { - notice_lang(s_OperServ, u, NICK_X_TRUNCATED, newnick, NICKMAX - 2, newnick); - params[1] = params[1].substr(0, NICKMAX - 2); - newnick = params[1].c_str(); + notice_lang(s_OperServ, u, NICK_X_TRUNCATED, newnick.c_str(), NICKMAX - 2, newnick.c_str()); + newnick = params[1].substr(0, NICKMAX - 2); } /* Check for valid characters */ - if (*newnick == '-' || isdigit(*newnick)) + if (newnick[0] == '-' || isdigit(newnick[0])) { - notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick); + notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick.c_str()); return MOD_CONT; } - for (c = newnick; *c && c - newnick < NICKMAX; ++c) + for (unsigned i = 0; i < newnick.size(); ++i) { - if (!isvalidnick(*c)) + if (!isvalidnick(newnick[i])) { - notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick); + notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick.c_str()); return MOD_CONT; } } @@ -56,15 +54,15 @@ class CommandOSSVSNick : public Command /* Check for a nick in use or a forbidden/suspended nick */ if (!finduser(nick)) notice_lang(s_OperServ, u, NICK_X_NOT_IN_USE, nick); - else if (finduser(newnick)) - notice_lang(s_OperServ, u, NICK_X_IN_USE, newnick); - else if ((na = findnick(newnick)) && (na->HasFlag(NS_FORBIDDEN))) - notice_lang(s_OperServ, u, NICK_X_FORBIDDEN, newnick); + else if (finduser(newnick.c_str())) + notice_lang(s_OperServ, u, NICK_X_IN_USE, newnick.c_str()); + else if ((na = findnick(newnick.c_str())) && (na->HasFlag(NS_FORBIDDEN))) + notice_lang(s_OperServ, u, NICK_X_FORBIDDEN, newnick.c_str()); else { - notice_lang(s_OperServ, u, OPER_SVSNICK_NEWNICK, nick, newnick); - ircdproto->SendGlobops(s_OperServ, "%s used SVSNICK to change %s to %s", u->nick, nick, newnick); - ircdproto->SendForceNickChange(nick, newnick, time(NULL)); + notice_lang(s_OperServ, u, OPER_SVSNICK_NEWNICK, nick, newnick.c_str()); + ircdproto->SendGlobops(s_OperServ, "%s used SVSNICK to change %s to %s", u->nick, nick, newnick.c_str()); + ircdproto->SendForceNickChange(nick, newnick.c_str(), time(NULL)); } return MOD_CONT; } diff --git a/src/core/os_szline.c b/src/core/os_szline.c index fd7f73343..d0d9719dc 100644 --- a/src/core/os_szline.c +++ b/src/core/os_szline.c @@ -23,7 +23,7 @@ int szline_list(int number, SXLine *sx, User *u, int *sent_header); class CommandOSSZLine : public Command { private: - CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms) { int deleted = 0; unsigned last_param = 2; @@ -128,7 +128,7 @@ class CommandOSSZLine : 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 *mask; int res = 0; @@ -179,7 +179,7 @@ class CommandOSSZLine : public Command return MOD_CONT; } - CommandReturn DoList(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoList(User *u, const std::vector<ci::string> ¶ms) { const char *mask; int res, sent_header = 0; @@ -220,7 +220,7 @@ class CommandOSSZLine : public Command return MOD_CONT; } - CommandReturn DoView(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoView(User *u, const std::vector<ci::string> ¶ms) { const char *mask; int res, sent_header = 0; @@ -273,7 +273,7 @@ class CommandOSSZLine : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; diff --git a/src/core/os_umode.c b/src/core/os_umode.c index 323f4f3c1..35f5db994 100644 --- a/src/core/os_umode.c +++ b/src/core/os_umode.c @@ -22,7 +22,7 @@ class CommandOSUMode : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *nick = params[0].c_str(); const char *modes = params[1].c_str(); diff --git a/src/core/os_update.c b/src/core/os_update.c index 94395a88c..888feb73f 100644 --- a/src/core/os_update.c +++ b/src/core/os_update.c @@ -22,7 +22,7 @@ class CommandOSUpdate : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { notice_lang(s_OperServ, u, OPER_UPDATING); save_data = 1; diff --git a/src/core/os_userlist.c b/src/core/os_userlist.c index a73668f4b..e96e460cb 100644 --- a/src/core/os_userlist.c +++ b/src/core/os_userlist.c @@ -22,7 +22,7 @@ class CommandOSUserList : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *pattern = params.size() > 0 ? params[0].c_str() : NULL; ci::string opt = params.size() > 1 ? params[1] : ""; diff --git a/src/core/ss_main.c b/src/core/ss_main.c index 39b98e6da..90161f3a4 100644 --- a/src/core/ss_main.c +++ b/src/core/ss_main.c @@ -24,7 +24,7 @@ class CommandSSHelp : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ircdproto->SendMessage(statserv, u->nick, "This is a test of the emergency StatServ system."); return MOD_CONT; diff --git a/src/modules/cs_appendtopic.c b/src/modules/cs_appendtopic.c index 60310b82b..7e050fd57 100644 --- a/src/modules/cs_appendtopic.c +++ b/src/modules/cs_appendtopic.c @@ -57,7 +57,7 @@ class CommandCSAppendTopic : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); const char *newtopic = params[1].c_str(); diff --git a/src/modules/cs_enforce.c b/src/modules/cs_enforce.c index 8dc9d0722..0c384a237 100644 --- a/src/modules/cs_enforce.c +++ b/src/modules/cs_enforce.c @@ -182,7 +182,7 @@ class CommandCSEnforce : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); ci::string what = params.size() > 1 ? params[1] : ""; diff --git a/src/modules/cs_tban.c b/src/modules/cs_tban.c index 1aea779f5..3368955b4 100644 --- a/src/modules/cs_tban.c +++ b/src/modules/cs_tban.c @@ -43,7 +43,7 @@ class CommandCSTBan : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { char mask[BUFSIZE]; Channel *c; diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c index 4601c931b..c2d42d4aa 100644 --- a/src/modules/hs_request.c +++ b/src/modules/hs_request.c @@ -74,7 +74,7 @@ class CommandHSRequest : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { char *nick; const char *rawhostmask = params[0].c_str(); @@ -206,7 +206,7 @@ class CommandHSActivate : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { if (!u->nc->HasPriv("hostserv/set")) { @@ -271,7 +271,7 @@ class CommandHSReject : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { if (!u->nc->HasPriv("hostserv/set")) { @@ -383,7 +383,7 @@ class CommandHSWaiting : public HSListBase { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { return this->DoList(u); } diff --git a/src/modules/os_info.c b/src/modules/os_info.c index a56aa724f..4f64738a4 100644 --- a/src/modules/os_info.c +++ b/src/modules/os_info.c @@ -52,7 +52,7 @@ static Module *me; class CommandNSOInfo : 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 *info = params.size() > 2 ? params[2].c_str() : NULL; @@ -83,7 +83,7 @@ class CommandNSOInfo : 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(); NickAlias *na = NULL; @@ -110,7 +110,7 @@ class CommandNSOInfo : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[0]; @@ -139,7 +139,7 @@ class CommandNSOInfo : public Command class CommandCSOInfo : public Command { private: - CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms) + CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); const char *info = params.size() > 2 ? params[2].c_str() : NULL; @@ -164,7 +164,7 @@ class CommandCSOInfo : 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 *chan = params[0].c_str(); ChannelInfo *ci = cs_findchan(chan); @@ -185,7 +185,7 @@ class CommandCSOInfo : public Command { } - CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { ci::string cmd = params[1]; |