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:
@@ -57,7 +57,7 @@ class CommandCSAppendTopic : public Command
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<std::string> ¶ms)
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
const char *newtopic = params[1].c_str();
|
||||
|
||||
+12
-12
@@ -178,10 +178,10 @@ class CommandCSEnforce : public Command
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<std::string> ¶ms)
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -43,7 +43,7 @@ class CommandCSTBan : public Command
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<std::string> ¶ms)
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
char mask[BUFSIZE];
|
||||
Channel *c;
|
||||
|
||||
+10
-10
@@ -74,7 +74,7 @@ class CommandHSRequest : public Command
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<std::string> ¶ms)
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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> ¶ms)
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
if (!u->nc->HasPriv("hostserv/set"))
|
||||
{
|
||||
@@ -271,7 +271,7 @@ class CommandHSReject : public Command
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<std::string> ¶ms)
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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> ¶ms)
|
||||
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> ¶ms)
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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> ¶ms)
|
||||
EventReturn OnPreCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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;
|
||||
|
||||
@@ -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> ¶ms)
|
||||
EventReturn OnPreCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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
@@ -52,7 +52,7 @@ static Module *me;
|
||||
class CommandNSOInfo : public Command
|
||||
{
|
||||
private:
|
||||
CommandReturn DoAdd(User *u, std::vector<std::string> ¶ms)
|
||||
CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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> ¶ms)
|
||||
CommandReturn DoDel(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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> ¶ms)
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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> ¶ms)
|
||||
CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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> ¶ms)
|
||||
CommandReturn DoDel(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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> ¶ms)
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
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> ¶ms)
|
||||
void OnPostCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> ¶ms)
|
||||
{
|
||||
if (command == "INFO")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user