summaryrefslogtreecommitdiff
path: root/src/modules/m_alias.cpp
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-04 22:17:02 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-04 22:17:02 +0000
commit6b10fa52627058111ad55531c8a97ae3de2d0b7d (patch)
tree132927429d53d396969ae6ca2cc94704d35d35c3 /src/modules/m_alias.cpp
parent95bc4eb84189edc0071b17774dcd58a535765847 (diff)
First attempt at converting to new command handler, please review diff Brain.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9613 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_alias.cpp')
-rw-r--r--src/modules/m_alias.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index 160de3327..ffe2946a5 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -126,7 +126,7 @@ class ModuleAlias : public Module
}
}
- virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line)
+ virtual int OnPreCommand(const std::string &command, const std::vector<std::string> &parameters, User *user, bool validated, const std::string &original_line)
{
User *u = NULL;
@@ -247,16 +247,15 @@ class ModuleAlias : public Module
SearchAndReplace(newline, "\r", "$");
irc::tokenstream ss(newline);
- const char* parv[MAXPARAMETERS];
- int x = 0;
- while (ss.GetToken(pars[x]) && x < MAXPARAMETERS)
+ std::vector<std::string> parms;
+ int x = 1;
+ while (ss.GetToken(pars[x]) && parms.size() <= MAXPARAMETERS)
{
- parv[x] = pars[x].c_str();
+ parms.push_back(pars[x]);
x++;
}
-
- ServerInstance->Parser->CallHandler(parv[0], &parv[1], x-1, user);
+ ServerInstance->Parser->CallHandler(pars[0], parms, user);
}
virtual void OnRehash(User* user, const std::string &parameter)