From ffbd1eebf0b82bf40482879f410f58874030a695 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 4 May 2008 21:37:36 +0000 Subject: Conversion of command handler params from "const char* const* parameters, int pcnt" to "const std::vector& 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 --- src/users.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/users.cpp') 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 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(), this, true, "LUSERS")); if (!MOD_RESULT) - ServerInstance->CallCommandHandler("LUSERS", NULL, 0, this); + ServerInstance->CallCommandHandler("LUSERS", std::vector(), 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 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; } -- cgit v1.3.1-10-gc9f91