summaryrefslogtreecommitdiff
path: root/src/modules/m_svshold.cpp
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-05 02:34:46 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-05 02:34:46 +0000
commit76b2c5c9cd6c2935c3e006396db8696c1bc18ea3 (patch)
tree74b9b1e0bec7bf4fac6919a4fefb96cec1f03f4c /src/modules/m_svshold.cpp
parent1b4925f99fb39d59e88c98db7fae8512e7f54c7b (diff)
Convert a few
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9631 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_svshold.cpp')
-rw-r--r--src/modules/m_svshold.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp
index 4a650fb1f..ed4fa86cf 100644
--- a/src/modules/m_svshold.cpp
+++ b/src/modules/m_svshold.cpp
@@ -57,7 +57,7 @@ class CommandSvshold : public Command
TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END);
}
- CmdResult Handle(const char* const* parameters, int pcnt, User *user)
+ CmdResult Handle(const std::vector<std::string> &parameters, User *user)
{
/* syntax: svshold nickname time :reason goes here */
/* 'time' is a human-readable timestring, like 2d3h2s. */
@@ -68,9 +68,9 @@ class CommandSvshold : public Command
return CMD_FAILURE;
}
- if (pcnt == 1)
+ if (parameters.size() == 1)
{
- SVSHoldMap::iterator n = HoldMap.find(parameters[0]);
+ SVSHoldMap::iterator n = HoldMap.find(parameters[0].c_str());
if (n != HoldMap.end())
{
/* form: svshold nickname removes a hold. */
@@ -97,40 +97,40 @@ class CommandSvshold : public Command
delete n->second;
}
}
- else if (pcnt >= 2)
+ else if (parameters.size() >= 2)
{
/* full form to add a SVSHold */
- if (ServerInstance->IsNick(parameters[0]))
+ if (ServerInstance->IsNick(parameters[0].c_str()))
{
// parameters[0] = w00t
// parameters[1] = 1h3m2s
// parameters[2] = Registered nickname
/* Already exists? */
- if (HoldMap.find(parameters[0]) != HoldMap.end())
+ if (HoldMap.find(parameters[0].c_str()) != HoldMap.end())
{
- user->WriteServ( "385 %s %s :SVSHOLD already exists", user->nick, parameters[0]);
+ user->WriteServ( "385 %s %s :SVSHOLD already exists", user->nick, parameters[0].c_str());
return CMD_FAILURE;
}
unsigned long length = ServerInstance->Duration(parameters[1]);
- std::string reason = (pcnt > 2) ? parameters[2] : "No reason supplied";
+ std::string reason = (parameters.size() > 2) ? parameters[2] : "No reason supplied";
SVSHold* S = new SVSHold(parameters[0], user->nick, ServerInstance->Time(), length, reason);
SVSHolds.push_back(S);
- HoldMap[parameters[0]] = S;
+ HoldMap[parameters[0].c_str()] = S;
std::sort(SVSHolds.begin(), SVSHolds.end(), SVSHoldComp);
if(length > 0)
{
- user->WriteServ( "385 %s %s :Added %lu second SVSHOLD (%s)", user->nick, parameters[0], length, reason.c_str());
- ServerInstance->SNO->WriteToSnoMask('A', "%s added %lu second SVSHOLD on %s (%s)", user->nick, length, parameters[0], reason.c_str());
+ user->WriteServ( "385 %s %s :Added %lu second SVSHOLD (%s)", user->nick, parameters[0].c_str(), length, reason.c_str());
+ ServerInstance->SNO->WriteToSnoMask('A', "%s added %lu second SVSHOLD on %s (%s)", user->nick, length, parameters[0].c_str(), reason.c_str());
}
else
{
- user->WriteServ( "385 %s %s :Added permanent SVSHOLD on %s (%s)", user->nick, parameters[0], parameters[0], reason.c_str());
- ServerInstance->SNO->WriteToSnoMask('A', "%s added permanent SVSHOLD on %s (%s)", user->nick, parameters[0], reason.c_str());
+ user->WriteServ( "385 %s %s :Added permanent SVSHOLD on %s (%s)", user->nick, parameters[0].c_str(), parameters[0].c_str(), reason.c_str());
+ ServerInstance->SNO->WriteToSnoMask('A', "%s added permanent SVSHOLD on %s (%s)", user->nick, parameters[0].c_str(), reason.c_str());
}
}
else