diff options
| author | 2008-05-04 21:37:36 +0000 | |
|---|---|---|
| committer | 2008-05-04 21:37:36 +0000 | |
| commit | ffbd1eebf0b82bf40482879f410f58874030a695 (patch) | |
| tree | ef64846a1dcc27e8768723e30b5c4891f64e2942 /src/users.cpp | |
| parent | Comment and improve check for access to ~/.inspircd/startup.log (diff) | |
Conversion of command handler params from "const char* const* parameters, int pcnt" to "const std::vector<std::string>& parameters". All of core is converted, but cant test it till the modules are converted.
IMPORTANT: The mode parser public calls have had to be tweaked a bit to also use the string vector. Note that this makes a LOT of our core a bit messy and paves the way to convert a lot of stuff from the mess
of .c_str() calls to using std::string params directly.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9608 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
| -rw-r--r-- | src/users.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/users.cpp b/src/users.cpp index 70f90a0a9..d8ed553a7 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -789,8 +789,11 @@ void User::UnOper() } } - const char* parameters[] = { this->nick, moderemove.c_str() }; - ServerInstance->Parser->CallHandler("MODE", parameters, 2, this); + std::vector<std::string> parameters; + parameters.push_back(this->nick); + parameters.push_back(moderemove); + + ServerInstance->Parser->CallHandler("MODE", parameters, this); /* unset their oper type (what IS_OPER checks), and remove +o */ *this->oper = 0; @@ -921,9 +924,9 @@ void User::FullConnect() /* Trigger LUSERS output, give modules a chance too */ int MOD_RESULT = 0; - FOREACH_RESULT(I_OnPreCommand, OnPreCommand("LUSERS", NULL, 0, this, true, "LUSERS")); + FOREACH_RESULT(I_OnPreCommand, OnPreCommand("LUSERS", std::vector<std::string>(), this, true, "LUSERS")); if (!MOD_RESULT) - ServerInstance->CallCommandHandler("LUSERS", NULL, 0, this); + ServerInstance->CallCommandHandler("LUSERS", std::vector<std::string>(), this); /* * We don't set REG_ALL until triggering OnUserConnect, so some module events don't spew out stuff @@ -993,8 +996,10 @@ bool User::ForceNickChange(const char* newnick) Command* nickhandler = ServerInstance->Parser->GetHandler("NICK"); if (nickhandler) // wtfbbq, when would this not be here { + std::vector<std::string> parameters; nickhandler->HandleInternal(1, dummy); - bool result = (ServerInstance->Parser->CallHandler("NICK", &newnick, 1, this) == CMD_SUCCESS); + parameters.push_back(newnick); + bool result = (ServerInstance->Parser->CallHandler("NICK", parameters, this) == CMD_SUCCESS); nickhandler->HandleInternal(0, dummy); return result; } |
