From c2d1f2cdafb0a38446844f6bd3d683e8636e37b4 Mon Sep 17 00:00:00 2001 From: peavey Date: Sun, 4 May 2008 23:28:57 +0000 Subject: Convert a whole bunch more git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9620 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cban.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/modules/m_cban.cpp') diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 10948caf7..94d99c374 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -88,25 +88,25 @@ class CommandCBan : public Command TRANSLATE4(TR_TEXT,TR_TEXT,TR_TEXT,TR_END); } - CmdResult Handle(const char* const* parameters, int pcnt, User *user) + CmdResult Handle(const std::vector ¶meters, User *user) { /* syntax: CBAN #channel time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ - if(pcnt == 1) + if (parameters.size() == 1) { - if (ServerInstance->XLines->DelLine(parameters[0], "CBAN", user)) + if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "CBAN", user)) { - ServerInstance->SNO->WriteToSnoMask('x',"%s Removed CBan on %s.",user->nick,parameters[0]); + ServerInstance->SNO->WriteToSnoMask('x',"%s Removed CBan on %s.",user->nick,parameters[0].c_str()); } else { - user->WriteServ("NOTICE %s :*** CBan %s not found in list, try /stats C.",user->nick,parameters[0]); + user->WriteServ("NOTICE %s :*** CBan %s not found in list, try /stats C.",user->nick,parameters[0].c_str()); } return CMD_SUCCESS; } - else if (pcnt >= 2) + else if (parameters.size() >= 2) { // Adding - XXX todo make this respect tag perhaps.. long duration = ServerInstance->Duration(parameters[1]); @@ -114,7 +114,7 @@ class CommandCBan : public Command try { - r = new CBan(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2], parameters[0]); + r = new CBan(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2].c_str(), parameters[0].c_str()); } catch (...) { @@ -127,12 +127,12 @@ class CommandCBan : public Command { if (!duration) { - ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent CBan for %s.", user->nick, parameters[0]); + ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent CBan for %s.", user->nick, parameters[0].c_str()); } else { time_t c_requires_crap = duration + ServerInstance->Time(); - ServerInstance->SNO->WriteToSnoMask('x', "%s added timed CBan for %s, expires on %s", user->nick, parameters[0], + ServerInstance->SNO->WriteToSnoMask('x', "%s added timed CBan for %s, expires on %s", user->nick, parameters[0].c_str(), ServerInstance->TimeString(c_requires_crap).c_str()); } @@ -141,7 +141,7 @@ class CommandCBan : public Command else { delete r; - user->WriteServ("NOTICE %s :*** CBan for %s already exists", user->nick, parameters[0]); + user->WriteServ("NOTICE %s :*** CBan for %s already exists", user->nick, parameters[0].c_str()); } } } -- cgit v1.2.3