1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 23:53:13 +02:00

Changed params parameter of Command's Execute() from std::vector<std::string> to std::vector<ci::string>, seems to have no ill effects but may require some testing to be sure.

Also a few minor cleanups here and there.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2392 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
cyberbotx
2009-07-25 00:37:43 +00:00
parent 443654f15b
commit b2a57b0974
120 changed files with 777 additions and 851 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ class CommandCSAppendTopic : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *chan = params[0].c_str();
const char *newtopic = params[1].c_str();
+12 -12
View File
@@ -178,10 +178,10 @@ class CommandCSEnforce : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *chan = params[0].c_str();
const char *what = params.size() > 1 ? params[1].c_str() : NULL;
ci::string what = params.size() > 1 ? params[1] : "";
Channel *c = findchan(chan);
ChannelInfo *ci;
@@ -196,30 +196,30 @@ class CommandCSEnforce : public Command
notice_lang(s_ChanServ, u, ACCESS_DENIED);
else
{
if (!what || !stricmp(what, "SET"))
if (what.empty() || what == "SET")
{
this->DoSet(c);
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, what ? what : "SET");
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, !what.empty() ? what.c_str() : "SET");
}
else if (!stricmp(what, "MODES"))
else if (what == "MODES")
{
this->DoModes(c);
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, what);
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, what.c_str());
}
else if (!stricmp(what, "SECUREOPS"))
else if (what == "SECUREOPS")
{
this->DoSecureOps(c);
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, what);
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, what.c_str());
}
else if (!stricmp(what, "RESTRICTED"))
else if (what == "RESTRICTED")
{
this->DoRestricted(c);
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, what);
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, what.c_str());
}
else if (!stricmp(what, "+R"))
else if (what == "+R")
{
this->DoCModeR(c);
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, what);
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, what.c_str());
}
else
this->OnSyntaxError(u);
+1 -1
View File
@@ -43,7 +43,7 @@ class CommandCSTBan : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
char mask[BUFSIZE];
Channel *c;
+10 -10
View File
@@ -74,7 +74,7 @@ class CommandHSRequest : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
char *nick;
const char *rawhostmask = params[0].c_str();
@@ -206,7 +206,7 @@ class CommandHSActivate : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
if (!u->nc->HasPriv("hostserv/set"))
{
@@ -271,7 +271,7 @@ class CommandHSReject : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
if (!u->nc->HasPriv("hostserv/set"))
{
@@ -330,7 +330,7 @@ class CommandHSReject : public Command
class HSListBase : public Command
{
protected:
CommandReturn DoList(User *u, std::vector<std::string> &params)
CommandReturn DoList(User *u)
{
if (!u->nc->HasPriv("hostserv/set"))
{
@@ -383,9 +383,9 @@ class CommandHSWaiting : public HSListBase
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return this->DoList(u, params);
return this->DoList(u);
}
bool OnHelp(User *u, const ci::string &subcommand)
@@ -691,17 +691,17 @@ class HSRequest : public Module
delete [] HSRequestDBName;
}
EventReturn OnPreCommand(User *u, const std::string &service, const std::string &command, const std::vector<std::string> &params)
EventReturn OnPreCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> &params)
{
if (service == s_HostServ)
{
if (command == "LIST")
{
const char *key = params.size() ? params[0].c_str() : NULL;
ci::string key = params.size() ? params[0] : "";
if (key && !stricmp(key, "+req"))
if (!key.empty() && key == "+req")
{
std::vector<std::string> emptyParams;
std::vector<ci::string> emptyParams;
Command *c = findCommand(HOSTSERV, "WAITING");
c->Execute(u, emptyParams);
return EVENT_STOP;
+3 -3
View File
@@ -101,7 +101,7 @@ class NSMaxEmail : public Module
my_load_config();
}
EventReturn OnPreCommand(User *u, const std::string &service, const std::string &command, const std::vector<std::string> &params)
EventReturn OnPreCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> &params)
{
if (service == s_NickServ)
{
@@ -112,10 +112,10 @@ class NSMaxEmail : public Module
}
else if (command == "SET")
{
const char *set = params[0].c_str();
ci::string set = params[0];
const char *email = params.size() > 1 ? params[1].c_str() : NULL;
if (!stricmp(set, "email") && check_email_limit_reached(email, u))
if (set == "email" && check_email_limit_reached(email, u))
return EVENT_STOP;
}
}
+13 -13
View File
@@ -52,7 +52,7 @@ static Module *me;
class CommandNSOInfo : public Command
{
private:
CommandReturn DoAdd(User *u, std::vector<std::string> &params)
CommandReturn DoAdd(User *u, std::vector<ci::string> &params)
{
const char *nick = params[1].c_str();
const char *info = params.size() > 2 ? params[2].c_str() : NULL;
@@ -83,7 +83,7 @@ class CommandNSOInfo : public Command
return MOD_CONT;
}
CommandReturn DoDel(User *u, std::vector<std::string> &params)
CommandReturn DoDel(User *u, std::vector<ci::string> &params)
{
const char *nick = params[1].c_str();
NickAlias *na = NULL;
@@ -110,13 +110,13 @@ class CommandNSOInfo : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *cmd = params[0].c_str();
ci::string cmd = params[0];
if (!strcasecmp(cmd, "ADD"))
if (cmd == "ADD")
return this->DoAdd(u, params);
else if (!strcasecmp(cmd, "DEL"))
else if (cmd == "DEL")
return this->DoDel(u, params);
else
this->OnSyntaxError(u);
@@ -141,7 +141,7 @@ class CommandNSOInfo : public Command
class CommandCSOInfo : public Command
{
private:
CommandReturn DoAdd(User *u, std::vector<std::string> &params)
CommandReturn DoAdd(User *u, std::vector<ci::string> &params)
{
const char *chan = params[0].c_str();
const char *info = params.size() > 2 ? params[2].c_str() : NULL;
@@ -166,7 +166,7 @@ class CommandCSOInfo : public Command
return MOD_CONT;
}
CommandReturn DoDel(User *u, std::vector<std::string> &params)
CommandReturn DoDel(User *u, std::vector<ci::string> &params)
{
const char *chan = params[0].c_str();
ChannelInfo *ci = cs_findchan(chan);
@@ -187,13 +187,13 @@ class CommandCSOInfo : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *cmd = params[1].c_str();
ci::string cmd = params[1];
if (!strcasecmp(cmd, "ADD"))
if (cmd == "ADD")
return this->DoAdd(u, params);
else if (!strcasecmp(cmd, "DEL"))
else if (cmd == "DEL")
return this->DoDel(u, params);
else
this->OnSyntaxError(u);
@@ -502,7 +502,7 @@ class OSInfo : public Module
alog("os_info.c: ERROR: An error has occured while reloading the configuration file");
}
void OnPostCommand(User *u, const std::string &service, const std::string &command, const std::vector<std::string> &params)
void OnPostCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> &params)
{
if (command == "INFO")
{