1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 07:56:39 +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
+3 -3
View File
@@ -249,7 +249,7 @@ class CoreExport Command
/** Execute this command.
* @param u The user executing the command.
*/
virtual CommandReturn Execute(User *u, std::vector<std::string> &);
virtual CommandReturn Execute(User *u, std::vector<ci::string> &);
/** Requested when the user is requesting help on this command. Help on this command should be sent to the user.
* @param u The user requesting help
@@ -519,7 +519,7 @@ class CoreExport Module
* @param params The parameters the user is sending
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
*/
virtual EventReturn OnPreCommand(User *u, const std::string &service, const std::string &command, const std::vector<std::string> &params) { return EVENT_CONTINUE; }
virtual EventReturn OnPreCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> &params) { return EVENT_CONTINUE; }
/** Called after a command has been executed.
* @param u The user executing the command
@@ -527,7 +527,7 @@ class CoreExport Module
* @param command The command the user executed
* @param params The parameters the user sent
*/
virtual void OnPostCommand(User *u, const std::string &service, const std::string &command, const std::vector<std::string> &params) { }
virtual void OnPostCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> &params) { }
/** Called when anope saves databases.
* NOTE: This event is deprecated pending new database handling.
+1 -1
View File
@@ -34,7 +34,7 @@ Command::~Command()
}
}
CommandReturn Command::Execute(User *u, std::vector<std::string> &) { return MOD_CONT; }
CommandReturn Command::Execute(User *u, std::vector<ci::string> &) { return MOD_CONT; }
bool Command::OnHelp(User *u, const ci::string &subcommand) { return false; }
+4 -4
View File
@@ -88,7 +88,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
// Check whether or not access string is empty
}
std::vector<std::string> params;
std::vector<ci::string> params;
std::string curparam;
char *s = NULL;
while ((s = strtok(NULL, " ")))
@@ -111,7 +111,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
curparam.erase(curparam.size() - 1, curparam.size());
// Add it
params.push_back(curparam);
params.push_back(curparam.c_str());
}
if (params.size() < c->MinParams)
@@ -121,7 +121,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
}
EventReturn MOD_RESULT = EVENT_CONTINUE;
FOREACH_RESULT(I_OnPreCommand, OnPreCommand(u, c->service, c->name, params));
FOREACH_RESULT(I_OnPreCommand, OnPreCommand(u, c->service, c->name.c_str(), params));
if (MOD_RESULT == EVENT_STOP)
return;
@@ -174,7 +174,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
retVal = c->Execute(u, params);
FOREACH_MOD(I_OnPostCommand, OnPostCommand(u, c->service, c->name, params));
FOREACH_MOD(I_OnPostCommand, OnPostCommand(u, c->service, c->name.c_str(), params));
}
/*************************************************************************/
+1 -4
View File
@@ -20,10 +20,9 @@ class CommandBSAct : public Command
public:
CommandBSAct() : Command("ACT", 2, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
ChannelInfo *ci = cs_findchan(params[0].c_str());
@@ -47,9 +46,7 @@ class CommandBSAct : public Command
size_t i = 0;
while ((i = params[1].find_first_of("\001"), i) && i != std::string::npos)
{
params[1].erase(i, 1);
}
ircdproto->SendAction(ci->bi, ci->name, "%s", params[1].c_str());
ci->bi->lastmsg = time(NULL);
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandBSAssign : 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 *nick = params[1].c_str();
+8 -18
View File
@@ -234,15 +234,15 @@ class CommandBSBadwords : 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 *cmd = params[1].c_str();
ci::string cmd = params[1];
const char *word = params.size() > 2 ? params[2].c_str() : NULL;
ChannelInfo *ci;
int need_args = (cmd && (!stricmp(cmd, "LIST") || !stricmp(cmd, "CLEAR")));
bool need_args = cmd == "LIST" || cmd == "CLEAR";
if (!cmd || (need_args ? 0 : !word))
if (need_args ? 0 : !word)
{
this->OnSyntaxError(u);
return MOD_CONT;
@@ -262,26 +262,16 @@ class CommandBSBadwords : public Command
return MOD_CONT;
}
if (stricmp(cmd, "ADD") == 0)
{
if (cmd == "ADD")
return this->DoAdd(u, ci, word);
}
else if (stricmp(cmd, "DEL") == 0)
{
else if (cmd == "DEL")
return this->DoDelete(u, ci, word);
}
else if (stricmp(cmd, "LIST") == 0)
{
else if (cmd == "LIST")
return this->DoList(u, ci, word);
}
else if (stricmp(cmd, "CLEAR") == 0)
{
else if (cmd == "CLEAR")
return this->DoClear(u, ci, word);
}
else
{
this->OnSyntaxError(u);
}
return MOD_CONT;
}
+8 -8
View File
@@ -18,7 +18,7 @@
class CommandBSBot : 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 *user = params.size() > 2 ? params[2].c_str() : NULL;
@@ -135,7 +135,7 @@ class CommandBSBot : public Command
return MOD_CONT;
}
CommandReturn DoChange(User *u, std::vector<std::string> &params)
CommandReturn DoChange(User *u, std::vector<ci::string> &params)
{
const char *oldnick = params[1].c_str();
const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
@@ -315,7 +315,7 @@ class CommandBSBot : 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();
BotInfo *bi;
@@ -353,9 +353,9 @@ class CommandBSBot : public Command
this->SetFlag(CFLAG_STRIP_CHANNEL);
}
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 (readonly)
{
@@ -363,7 +363,7 @@ class CommandBSBot : public Command
return MOD_CONT;
}
if (!stricmp(cmd, "ADD"))
if (cmd == "ADD")
{
// ADD nick user host real - 5
if (!u->nc->HasCommand("botserv/bot/add"))
@@ -384,7 +384,7 @@ class CommandBSBot : public Command
return this->DoAdd(u, params);
}
else if (!stricmp(cmd, "CHANGE"))
else if (cmd == "CHANGE")
{
// CHANGE oldn newn user host real - 6
// but only oldn and newn are required
@@ -402,7 +402,7 @@ class CommandBSBot : public Command
return this->DoChange(u, params);
}
else if (!stricmp(cmd, "DEL"))
else if (cmd == "DEL")
{
// DEL nick
if (!u->nc->HasCommand("botserv/bot/del"))
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandBSBotList : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
int i, count = 0;
BotInfo *bi;
+4 -4
View File
@@ -6,8 +6,8 @@
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
@@ -23,8 +23,8 @@ class CommandBSHelp : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
this->SetFlag(CFLAG_STRIP_CHANNEL);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
mod_help_cmd(s_BotServ, u, BOTSERV, params[0].c_str());
return MOD_CONT;
+1 -1
View File
@@ -52,7 +52,7 @@ class CommandBSInfo : public Command
this->SetFlag(CFLAG_STRIP_CHANNEL);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
BotInfo *bi;
ChannelInfo *ci;
+22 -22
View File
@@ -24,28 +24,28 @@ class CommandBSKick : 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 *option = params[1].c_str();
const char *value = params[2].c_str();
ci::string option = params[1];
ci::string value = params[2];
const char *ttb = params.size() > 3 ? params[3].c_str() : NULL;
ChannelInfo *ci = cs_findchan(chan);
if (readonly)
notice_lang(s_BotServ, u, BOT_KICK_DISABLED);
else if (!chan || !option || !value)
else if (!chan || option.empty() || value.empty())
syntax_error(s_BotServ, u, "KICK", BOT_KICK_SYNTAX);
else if (stricmp(value, "ON") && stricmp(value, "OFF"))
else if (value != "ON" && value != "OFF")
syntax_error(s_BotServ, u, "KICK", BOT_KICK_SYNTAX);
else if (!check_access(u, ci, CA_SET) && !u->nc->HasPriv("botserv/administration"))
notice_lang(s_BotServ, u, ACCESS_DENIED);
else if (!ci->bi)
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
else {
if (!stricmp(option, "BADWORDS")) {
if (!stricmp(value, "ON")) {
if (option == "BADWORDS") {
if (value == "ON") {
if (ttb) {
ci->ttb[TTB_BADWORDS] =
strtol(ttb, NULL, 10);
@@ -74,8 +74,8 @@ class CommandBSKick : public Command
ci->botflags &= ~BS_KICK_BADWORDS;
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_OFF);
}
} else if (!stricmp(option, "BOLDS")) {
if (!stricmp(value, "ON")) {
} else if (option == "BOLDS") {
if (value == "ON") {
if (ttb) {
ci->ttb[TTB_BOLDS] = strtol(ttb, NULL, 10);
if (errno == ERANGE || errno == EINVAL
@@ -99,8 +99,8 @@ class CommandBSKick : public Command
ci->botflags &= ~BS_KICK_BOLDS;
notice_lang(s_BotServ, u, BOT_KICK_BOLDS_OFF);
}
} else if (!stricmp(option, "CAPS")) {
if (!stricmp(value, "ON")) {
} else if (option == "CAPS") {
if (value == "ON") {
char *min = strtok(NULL, " ");
char *percent = strtok(NULL, " ");
@@ -144,8 +144,8 @@ class CommandBSKick : public Command
ci->botflags &= ~BS_KICK_CAPS;
notice_lang(s_BotServ, u, BOT_KICK_CAPS_OFF);
}
} else if (!stricmp(option, "COLORS")) {
if (!stricmp(value, "ON")) {
} else if (option == "COLORS") {
if (value == "ON") {
if (ttb) {
ci->ttb[TTB_COLORS] = strtol(ttb, NULL, 10);
if (errno == ERANGE || errno == EINVAL
@@ -169,8 +169,8 @@ class CommandBSKick : public Command
ci->botflags &= ~BS_KICK_COLORS;
notice_lang(s_BotServ, u, BOT_KICK_COLORS_OFF);
}
} else if (!stricmp(option, "FLOOD")) {
if (!stricmp(value, "ON")) {
} else if (option == "FLOOD") {
if (value == "ON") {
char *lines = strtok(NULL, " ");
char *secs = strtok(NULL, " ");
@@ -214,8 +214,8 @@ class CommandBSKick : public Command
ci->botflags &= ~BS_KICK_FLOOD;
notice_lang(s_BotServ, u, BOT_KICK_FLOOD_OFF);
}
} else if (!stricmp(option, "REPEAT")) {
if (!stricmp(value, "ON")) {
} else if (option == "REPEAT") {
if (value == "ON") {
char *times = strtok(NULL, " ");
if (ttb) {
@@ -250,8 +250,8 @@ class CommandBSKick : public Command
ci->botflags &= ~BS_KICK_REPEAT;
notice_lang(s_BotServ, u, BOT_KICK_REPEAT_OFF);
}
} else if (!stricmp(option, "REVERSES")) {
if (!stricmp(value, "ON")) {
} else if (option == "REVERSES") {
if (value == "ON") {
if (ttb) {
ci->ttb[TTB_REVERSES] =
strtol(ttb, NULL, 10);
@@ -276,8 +276,8 @@ class CommandBSKick : public Command
ci->botflags &= ~BS_KICK_REVERSES;
notice_lang(s_BotServ, u, BOT_KICK_REVERSES_OFF);
}
} else if (!stricmp(option, "UNDERLINES")) {
if (!stricmp(value, "ON")) {
} else if (option == "UNDERLINES") {
if (value == "ON") {
if (ttb) {
ci->ttb[TTB_UNDERLINES] =
strtol(ttb, NULL, 10);
@@ -303,7 +303,7 @@ class CommandBSKick : public Command
notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_OFF);
}
} else
notice_help(s_BotServ, u, BOT_KICK_UNKNOWN, option);
notice_help(s_BotServ, u, BOT_KICK_UNKNOWN, option.c_str());
}
return MOD_CONT;
}
+1 -2
View File
@@ -22,7 +22,7 @@ class CommandBSSay : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
ChannelInfo *ci;
@@ -37,7 +37,6 @@ class CommandBSSay : public Command
return MOD_CONT;
}
if (!ci->bi)
{
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
+25 -25
View File
@@ -23,11 +23,11 @@ class CommandBSSet : public Command
this->SetFlag(CFLAG_STRIP_CHANNEL);
}
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 *option = params[1].c_str();
const char *value = params[2].c_str();
ci::string option = params[1];
ci::string value = params[2];
ChannelInfo *ci;
if (readonly)
@@ -36,7 +36,7 @@ class CommandBSSet : public Command
return MOD_CONT;
}
if (u->nc->HasCommand("botserv/set/private") && !stricmp(option, "PRIVATE"))
if (u->nc->HasCommand("botserv/set/private") && option == "PRIVATE")
{
BotInfo *bi;
@@ -46,12 +46,12 @@ class CommandBSSet : public Command
return MOD_CONT;
}
if (!stricmp(value, "ON"))
if (value == "ON")
{
bi->flags |= BI_PRIVATE;
notice_lang(s_BotServ, u, BOT_SET_PRIVATE_ON, bi->nick);
}
else if (!stricmp(value, "OFF"))
else if (value == "OFF")
{
bi->flags &= ~BI_PRIVATE;
notice_lang(s_BotServ, u, BOT_SET_PRIVATE_OFF, bi->nick);
@@ -66,12 +66,12 @@ class CommandBSSet : public Command
else if (!u->nc->HasPriv("botserv/administration") && !check_access(u, ci, CA_SET))
notice_lang(s_BotServ, u, ACCESS_DENIED);
else {
if (!stricmp(option, "DONTKICKOPS")) {
if (!stricmp(value, "ON")) {
if (option == "DONTKICKOPS") {
if (value == "ON") {
ci->botflags |= BS_DONTKICKOPS;
notice_lang(s_BotServ, u, BOT_SET_DONTKICKOPS_ON,
ci->name);
} else if (!stricmp(value, "OFF")) {
} else if (value == "OFF") {
ci->botflags &= ~BS_DONTKICKOPS;
notice_lang(s_BotServ, u, BOT_SET_DONTKICKOPS_OFF,
ci->name);
@@ -79,12 +79,12 @@ class CommandBSSet : public Command
syntax_error(s_BotServ, u, "SET DONTKICKOPS",
BOT_SET_DONTKICKOPS_SYNTAX);
}
} else if (!stricmp(option, "DONTKICKVOICES")) {
if (!stricmp(value, "ON")) {
} else if (option == "DONTKICKVOICES") {
if (value == "ON") {
ci->botflags |= BS_DONTKICKVOICES;
notice_lang(s_BotServ, u, BOT_SET_DONTKICKVOICES_ON,
ci->name);
} else if (!stricmp(value, "OFF")) {
} else if (value == "OFF") {
ci->botflags &= ~BS_DONTKICKVOICES;
notice_lang(s_BotServ, u, BOT_SET_DONTKICKVOICES_OFF,
ci->name);
@@ -92,46 +92,46 @@ class CommandBSSet : public Command
syntax_error(s_BotServ, u, "SET DONTKICKVOICES",
BOT_SET_DONTKICKVOICES_SYNTAX);
}
} else if (!stricmp(option, "FANTASY")) {
if (!stricmp(value, "ON")) {
} else if (option == "FANTASY") {
if (value == "ON") {
ci->botflags |= BS_FANTASY;
notice_lang(s_BotServ, u, BOT_SET_FANTASY_ON, ci->name);
} else if (!stricmp(value, "OFF")) {
} else if (value == "OFF") {
ci->botflags &= ~BS_FANTASY;
notice_lang(s_BotServ, u, BOT_SET_FANTASY_OFF, ci->name);
} else {
syntax_error(s_BotServ, u, "SET FANTASY",
BOT_SET_FANTASY_SYNTAX);
}
} else if (!stricmp(option, "GREET")) {
if (!stricmp(value, "ON")) {
} else if (option == "GREET") {
if (value == "ON") {
ci->botflags |= BS_GREET;
notice_lang(s_BotServ, u, BOT_SET_GREET_ON, ci->name);
} else if (!stricmp(value, "OFF")) {
} else if (value == "OFF") {
ci->botflags &= ~BS_GREET;
notice_lang(s_BotServ, u, BOT_SET_GREET_OFF, ci->name);
} else {
syntax_error(s_BotServ, u, "SET GREET",
BOT_SET_GREET_SYNTAX);
}
} else if (u->nc->HasCommand("botserv/set/nobot") && !stricmp(option, "NOBOT")) {
if (!stricmp(value, "ON")) {
} else if (u->nc->HasCommand("botserv/set/nobot") && option == "NOBOT") {
if (value == "ON") {
ci->botflags |= BS_NOBOT;
if (ci->bi)
ci->bi->UnAssign(u, ci);
notice_lang(s_BotServ, u, BOT_SET_NOBOT_ON, ci->name);
} else if (!stricmp(value, "OFF")) {
} else if (value == "OFF") {
ci->botflags &= ~BS_NOBOT;
notice_lang(s_BotServ, u, BOT_SET_NOBOT_OFF, ci->name);
} else {
syntax_error(s_BotServ, u, "SET NOBOT",
BOT_SET_NOBOT_SYNTAX);
}
} else if (!stricmp(option, "SYMBIOSIS")) {
if (!stricmp(value, "ON")) {
} else if (option == "SYMBIOSIS") {
if (value == "ON") {
ci->botflags |= BS_SYMBIOSIS;
notice_lang(s_BotServ, u, BOT_SET_SYMBIOSIS_ON, ci->name);
} else if (!stricmp(value, "OFF")) {
} else if (value == "OFF") {
ci->botflags &= ~BS_SYMBIOSIS;
notice_lang(s_BotServ, u, BOT_SET_SYMBIOSIS_OFF, ci->name);
} else {
@@ -139,7 +139,7 @@ class CommandBSSet : public Command
BOT_SET_SYMBIOSIS_SYNTAX);
}
} else {
notice_help(s_BotServ, u, BOT_SET_UNKNOWN, option);
notice_help(s_BotServ, u, BOT_SET_UNKNOWN, option.c_str());
}
}
return MOD_CONT;
+1 -1
View File
@@ -24,7 +24,7 @@ class CommandBSUnassign : 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();
ChannelInfo *ci = cs_findchan(chan);
+17 -19
View File
@@ -88,10 +88,10 @@ class CommandCSAccess : 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 *cmd = params[1].c_str();
ci::string cmd = params[1];
const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
const char *s = params.size() > 3 ? params[3].c_str() : NULL;
@@ -102,12 +102,12 @@ class CommandCSAccess : public Command
unsigned i;
int level = 0, ulev;
int is_list = (cmd && !stricmp(cmd, "LIST"));
bool is_list = cmd == "LIST";
/* If LIST, we don't *require* any parameters, but we can take any.
* If DEL, we require a nick and no level.
* Else (ADD), we require a level (which implies a nick). */
if (!cmd || ((is_list || !stricmp(cmd, "CLEAR")) ? 0 : (!stricmp(cmd, "DEL")) ? (!nick || s) : !s))
if (is_list || cmd == "CLEAR" ? 0 : (cmd == "DEL" ? (!nick || s) : !s))
this->OnSyntaxError(u);
/* We still allow LIST in xOP mode, but not others */
else if ((ci->flags & CI_XOP) && !is_list)
@@ -123,7 +123,7 @@ class CommandCSAccess : public Command
(!is_list && !check_access(u, ci, CA_ACCESS_CHANGE) && !u->nc->HasPriv("chanserv/access/modify"))
))
notice_lang(s_ChanServ, u, ACCESS_DENIED);
else if (!stricmp(cmd, "ADD"))
else if (cmd == "ADD")
{
if (readonly)
{
@@ -200,7 +200,7 @@ class CommandCSAccess : public Command
alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ulev, level, na->nick, nc->display, ci->name);
notice_lang(s_ChanServ, u, CHAN_ACCESS_ADDED, nc->display, ci->name, level);
}
else if (!stricmp(cmd, "DEL"))
else if (cmd == "DEL")
{
int deleted;
if (readonly)
@@ -281,7 +281,7 @@ class CommandCSAccess : public Command
FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, u, (na->nick ? na->nick : NULL)));
}
}
else if (!stricmp(cmd, "LIST"))
else if (cmd == "LIST")
{
int sent_header = 0;
@@ -307,7 +307,7 @@ class CommandCSAccess : public Command
else
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_FOOTER, ci->name);
}
else if (!stricmp(cmd, "CLEAR"))
else if (cmd == "CLEAR")
{
if (readonly)
{
@@ -357,10 +357,10 @@ class CommandCSLevels : 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 *cmd = params[1].c_str();
ci::string cmd = params[1];
const char *what = params.size() > 2 ? params[2].c_str() : NULL;
const char *s = params.size() > 3 ? params[3].c_str() : NULL;
char *error;
@@ -372,15 +372,13 @@ class CommandCSLevels : public Command
/* If SET, we want two extra parameters; if DIS[ABLE] or FOUNDER, we want only
* one; else, we want none.
*/
if (!cmd
|| ((stricmp(cmd, "SET") == 0) ? !s
: ((strnicmp(cmd, "DIS", 3) == 0)) ? (!what || s) : !!what)) {
if (cmd == "SET" ? !s : (cmd.substr(0, 3) == "DIS" ? (!what || s) : !!what))
this->OnSyntaxError(u);
} else if (ci->flags & CI_XOP) {
else if (ci->flags & CI_XOP)
notice_lang(s_ChanServ, u, CHAN_LEVELS_XOP);
} else if (!is_founder(u, ci) && !u->nc->HasPriv("chanserv/access/modify")) {
else if (!is_founder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
notice_lang(s_ChanServ, u, ACCESS_DENIED);
} else if (stricmp(cmd, "SET") == 0) {
else if (cmd == "SET") {
level = strtol(s, &error, 10);
if (*error != '\0') {
@@ -409,7 +407,7 @@ class CommandCSLevels : public Command
notice_lang(s_ChanServ, u, CHAN_LEVELS_UNKNOWN, what, s_ChanServ);
} else if (stricmp(cmd, "DIS") == 0 || stricmp(cmd, "DISABLE") == 0) {
} else if (cmd == "DIS" || cmd == "DISABLE") {
for (i = 0; levelinfo[i].what >= 0; i++) {
if (stricmp(levelinfo[i].name, what) == 0) {
ci->levels[levelinfo[i].what] = ACCESS_INVALID;
@@ -424,7 +422,7 @@ class CommandCSLevels : public Command
}
notice_lang(s_ChanServ, u, CHAN_LEVELS_UNKNOWN, what, s_ChanServ);
} else if (stricmp(cmd, "LIST") == 0) {
} else if (cmd == "LIST") {
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_HEADER, chan);
if (!levelinfo_maxwidth) {
@@ -458,7 +456,7 @@ class CommandCSLevels : public Command
}
}
} else if (stricmp(cmd, "RESET") == 0) {
} else if (cmd == "RESET") {
reset_levels(ci);
alog("%s: %s!%s@%s reset levels definitions on channel %s",
+12 -17
View File
@@ -173,10 +173,10 @@ class CommandCSAKick : 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 *cmd = params[1].c_str();
ci::string cmd = params[1];
const char *mask = params.size() > 2 ? params[2].c_str() : NULL;
const char *reason = NULL;
@@ -196,15 +196,11 @@ class CommandCSAKick : public Command
const char *argv[3];
int count = 0;
if (!cmd || (!mask && (!stricmp(cmd, "ADD") || !stricmp(cmd, "STICK")
|| !stricmp(cmd, "UNSTICK")
|| !stricmp(cmd, "DEL")))) {
if (!mask && (cmd == "ADD" || cmd == "STICK" || cmd == "UNSTICK" || cmd == "DEL"))
syntax_error(s_ChanServ, u, "AKICK", CHAN_AKICK_SYNTAX);
} else if (!check_access(u, ci, CA_AKICK) && !u->nc->HasPriv("chanserv/access/modify"))
{
else if (!check_access(u, ci, CA_AKICK) && !u->nc->HasPriv("chanserv/access/modify"))
notice_lang(s_ChanServ, u, ACCESS_DENIED);
} else if (stricmp(cmd, "ADD") == 0) {
else if (cmd == "ADD") {
NickAlias *na = findnick(mask), *na2;
NickCore *nc = NULL;
const char *nick, *user, *host;
@@ -363,7 +359,7 @@ class CommandCSAKick : public Command
if (freemask)
delete [] mask;
} else if (stricmp(cmd, "STICK") == 0) {
} else if (cmd == "STICK") {
NickAlias *na;
NickCore *nc;
@@ -399,7 +395,7 @@ class CommandCSAKick : public Command
if (ci->c)
stick_mask(ci, akick);
} else if (stricmp(cmd, "UNSTICK") == 0) {
} else if (cmd == "UNSTICK") {
NickAlias *na;
NickCore *nc;
@@ -433,7 +429,7 @@ class CommandCSAKick : public Command
notice_lang(s_ChanServ, u, CHAN_AKICK_UNSTUCK, akick->u.mask,
ci->name);
} else if (stricmp(cmd, "DEL") == 0) {
} else if (cmd == "DEL") {
int deleted, a, b;
if (readonly) {
@@ -531,7 +527,7 @@ class CommandCSAKick : public Command
ci->akick =
static_cast<AutoKick *>(srealloc(ci->akick,sizeof(AutoKick) * ci->akickcount));
}
} else if (stricmp(cmd, "LIST") == 0) {
} else if (cmd == "LIST") {
int sent_header = 0;
if (ci->akickcount == 0) {
@@ -561,7 +557,7 @@ class CommandCSAKick : public Command
if (!sent_header)
notice_lang(s_ChanServ, u, CHAN_AKICK_NO_MATCH, chan);
} else if (stricmp(cmd, "VIEW") == 0) {
} else if (cmd == "VIEW") {
int sent_header = 0;
if (ci->akickcount == 0) {
notice_lang(s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, chan);
@@ -590,7 +586,7 @@ class CommandCSAKick : public Command
if (!sent_header)
notice_lang(s_ChanServ, u, CHAN_AKICK_NO_MATCH, chan);
} else if (stricmp(cmd, "ENFORCE") == 0) {
} else if (cmd == "ENFORCE") {
c = findchan(ci->name);
cu = NULL;
count = 0;
@@ -622,8 +618,7 @@ class CommandCSAKick : public Command
notice_lang(s_ChanServ, u, CHAN_AKICK_ENFORCE_DONE, chan, count);
} else if (stricmp(cmd, "CLEAR") == 0) {
} else if (cmd == "CLEAR") {
if (readonly) {
notice_lang(s_ChanServ, u, CHAN_AKICK_DISABLED);
return MOD_CONT;
+2 -4
View File
@@ -20,10 +20,9 @@ class CommandCSBan : public Command
public:
CommandCSBan() : Command("BAN", 2, 3)
{
}
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 *target = params[1].c_str();
@@ -33,7 +32,6 @@ class CommandCSBan : public Command
{
params[2].resize(200);
reason = params[2].c_str();
}
Channel *c = findchan(chan);
@@ -122,7 +120,7 @@ class CommandCSUnban : 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();
Channel *c;
+10 -10
View File
@@ -23,10 +23,10 @@ class CommandCSClear : 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[1].c_str();
ci::string what = params[1];
Channel *c = findchan(chan);
ChannelInfo *ci;
@@ -37,7 +37,7 @@ class CommandCSClear : public Command
notice_lang(s_ChanServ, u, CHAN_X_NOT_IN_USE, chan);
} else if (!u || !check_access(u, ci, CA_CLEAR)) {
notice_lang(s_ChanServ, u, ACCESS_DENIED);
} else if (stricmp(what, "bans") == 0) {
} else if (what == "bans") {
const char *av[2];
Entry *ban, *bnext;
@@ -52,7 +52,7 @@ class CommandCSClear : public Command
}
notice_lang(s_ChanServ, u, CHAN_CLEARED_BANS, chan);
} else if (ircd->except && stricmp(what, "excepts") == 0) {
} else if (ircd->except && what == "excepts") {
const char *av[2];
Entry *except, *bnext;
@@ -67,7 +67,7 @@ class CommandCSClear : public Command
}
notice_lang(s_ChanServ, u, CHAN_CLEARED_EXCEPTS, chan);
} else if (ircd->invitemode && stricmp(what, "invites") == 0) {
} else if (ircd->invitemode && what == "invites") {
const char *av[2];
Entry *invite, *bnext;
@@ -82,7 +82,7 @@ class CommandCSClear : public Command
}
notice_lang(s_ChanServ, u, CHAN_CLEARED_INVITES, chan);
} else if (stricmp(what, "modes") == 0) {
} else if (what == "modes") {
const char *argv[2];
if (c->mode) {
@@ -124,7 +124,7 @@ class CommandCSClear : public Command
}
notice_lang(s_ChanServ, u, CHAN_CLEARED_MODES, chan);
} else if (stricmp(what, "ops") == 0) {
} else if (what == "ops") {
const char *av[6]; /* The max we have to hold: chan, ts, modes(max3), nick, nick, nick */
int ac, isop, isadmin, isown, count, i;
char buf[BUFSIZE], tmp[BUFSIZE], tmp2[BUFSIZE];
@@ -212,7 +212,7 @@ class CommandCSClear : public Command
}
}
notice_lang(s_ChanServ, u, CHAN_CLEARED_OPS, chan);
} else if (ircd->halfop && stricmp(what, "hops") == 0) {
} else if (ircd->halfop && what == "hops") {
const char *av[4];
int ac;
char buf[BUFSIZE];
@@ -256,7 +256,7 @@ class CommandCSClear : public Command
do_cmode(s_ChanServ, ac, av);
}
notice_lang(s_ChanServ, u, CHAN_CLEARED_HOPS, chan);
} else if (stricmp(what, "voices") == 0) {
} else if (what == "voices") {
const char *av[4];
int ac;
char buf[BUFSIZE];
@@ -301,7 +301,7 @@ class CommandCSClear : public Command
do_cmode(s_ChanServ, ac, av);
}
notice_lang(s_ChanServ, u, CHAN_CLEARED_VOICES, chan);
} else if (stricmp(what, "users") == 0) {
} else if (what == "users") {
const char *av[3];
struct c_userlist *cu, *bnext;
char buf[256];
+1 -6
View File
@@ -24,7 +24,7 @@ class CommandCSDrop : public Command
this->SetFlag(CFLAG_ALLOW_SUSPENDED);
}
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();
ChannelInfo *ci;
@@ -108,8 +108,6 @@ class CommandCSDrop : public Command
}
};
class CSDrop : public Module
{
public:
@@ -126,7 +124,4 @@ class CSDrop : public Module
}
};
MODULE_INIT("cs_drop", CSDrop)
+1 -4
View File
@@ -20,10 +20,9 @@ class CommandCSForbid : public Command
public:
CommandCSForbid() : Command("FORBID", 1, 2, "chanserv/forbid")
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
ChannelInfo *ci;
const char *chan = params[0].c_str();
@@ -53,7 +52,6 @@ class CommandCSForbid : public Command
{
notice_lang(s_ChanServ, u, READ_ONLY_MODE);
return MOD_CONT;
}
if ((ci = cs_findchan(chan)) != NULL)
@@ -136,5 +134,4 @@ class CSForbid : public Module
}
};
MODULE_INIT("cs_forbid", CSForbid)
+1 -2
View File
@@ -20,10 +20,9 @@ class CommandCSGetKey : public Command
public:
CommandCSGetKey() : Command("GETKEY", 1, 1)
{
}
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();
ChannelInfo *ci;
+1 -1
View File
@@ -23,7 +23,7 @@ class CommandCSGetPass : public Command
this->SetFlag(CFLAG_ALLOW_SUSPENDED);
}
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();
char tmp_pass[PASSMAX];
+4 -4
View File
@@ -24,11 +24,11 @@ class CommandCSHelp : public Command
this->SetFlag(CFLAG_STRIP_CHANNEL);
}
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 (!stricmp(cmd, "LEVELS DESC"))
if (cmd == "LEVELS DESC")
{
int i;
notice_help(s_ChanServ, u, CHAN_HELP_LEVELS_DESC);
@@ -47,7 +47,7 @@ class CommandCSHelp : public Command
}
}
else
mod_help_cmd(s_ChanServ, u, CHANSERV, cmd);
mod_help_cmd(s_ChanServ, u, CHANSERV, cmd.c_str());
return MOD_CONT;
}
+1 -2
View File
@@ -20,10 +20,9 @@ class CommandCSIdentify : public Command
public:
CommandCSIdentify(const std::string &cname) : Command(cname, 2, 2)
{
}
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 *pass = params[1].c_str();
+3 -9
View File
@@ -37,10 +37,10 @@ class CommandCSInfo : public Command
this->SetFlag(CFLAG_ALLOW_FORBIDDEN);
}
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 *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : "";
ChannelInfo *ci;
char buf[BUFSIZE];
struct tm *tm;
@@ -63,9 +63,8 @@ class CommandCSInfo : public Command
return MOD_CONT;
}
/* Should we show all fields? Only for sadmins and identified users */
if (param && stricmp(param, "ALL") == 0 && (check_access(u, ci, CA_INFO) || has_auspex))
if (!param.empty() && param == "ALL" && (check_access(u, ci, CA_INFO) || has_auspex))
show_all = 1;
notice_lang(s_ChanServ, u, CHAN_INFO_HEADER, chan);
@@ -158,8 +157,6 @@ class CommandCSInfo : public Command
}
};
class CSInfo : public Module
{
public:
@@ -176,7 +173,4 @@ class CSInfo : public Module
}
};
MODULE_INIT("cs_info", CSInfo)
+2 -7
View File
@@ -20,9 +20,9 @@ class CommandCSInvite : public Command
public:
CommandCSInvite() : Command("INVITE", 1, 1)
{
}
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();
Channel *c;
@@ -64,9 +64,6 @@ class CommandCSInvite : public Command
}
};
class CSInvite : public Module
{
public:
@@ -83,6 +80,4 @@ class CSInvite : public Module
}
};
MODULE_INIT("cs_invite", CSInvite)
+1 -2
View File
@@ -20,10 +20,9 @@ class CommandCSKick : public Command
public:
CommandCSKick() : Command("KICK", 2, 3)
{
}
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 *target = params[1].c_str();
+7 -7
View File
@@ -19,12 +19,12 @@
class CommandCSList : public Command
{
public:
CommandCSList() : Command("LIST",1,2)
CommandCSList() : Command("LIST", 1, 2)
{
this->SetFlag(CFLAG_STRIP_CHANNEL);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *pattern = params[0].c_str();
int spattern_size;
@@ -93,14 +93,15 @@ public:
if (is_servadmin && params.size() > 1)
{
std::string keyword;
spacesepstream keywords(params[1]);
spacesepstream keywords(params[1].c_str());
while (keywords.GetToken(keyword))
{
if (stricmp(keyword.c_str(), "FORBIDDEN") == 0)
ci::string keyword_ci = keyword.c_str();
if (keyword_ci == "FORBIDDEN")
matchflags |= CI_FORBIDDEN;
if (stricmp(keyword.c_str(), "SUSPENDED") == 0)
if (keyword_ci == "SUSPENDED")
matchflags |= CI_SUSPENDED;
if (stricmp(keyword.c_str(), "NOEXPIRE") == 0)
if (keyword_ci == "NOEXPIRE")
matchflags |= CI_NO_EXPIRE;
}
@@ -110,7 +111,6 @@ public:
spattern = new char[spattern_size];
snprintf(spattern, spattern_size, "#%s", pattern);
notice_lang(s_ChanServ, u, CHAN_LIST_HEADER, pattern);
for (i = 0; i < 256; i++)
{
+1 -2
View File
@@ -47,10 +47,9 @@ class CommandCSLogout : public Command
public:
CommandCSLogout() : Command("LOGOUT", 1, 2)
{
}
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 *nick = params.size() > 1 ? params[1].c_str() : NULL;
+10 -21
View File
@@ -71,10 +71,9 @@ class CommandCSOp : public Command
public:
CommandCSOp() : Command("OP", 1, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return do_util(u, &csmodeutils[MUT_OP], (params.size() > 0 ? params[0].c_str() : NULL), (params.size() > 1 ? params[1].c_str() : NULL));
}
@@ -97,10 +96,9 @@ class CommandCSDeOp : public Command
public:
CommandCSDeOp() : Command("DEOP", 1, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return do_util(u, &csmodeutils[MUT_DEOP], (params.size() > 0 ? params[0].c_str() : NULL), (params.size() > 1 ? params[1].c_str() : NULL));
}
@@ -123,10 +121,9 @@ class CommandCSVoice : public Command
public:
CommandCSVoice() : Command("VOICE", 1, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return do_util(u, &csmodeutils[MUT_VOICE], (params.size() > 0 ? params[0].c_str() : NULL), (params.size() > 1 ? params[1].c_str() : NULL));
}
@@ -149,10 +146,9 @@ class CommandCSDeVoice : public Command
public:
CommandCSDeVoice() : Command("DEVOICE", 1, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return do_util(u, &csmodeutils[MUT_DEVOICE], (params.size() > 0 ? params[0].c_str() : NULL), (params.size() > 1 ? params[1].c_str() : NULL));
}
@@ -175,15 +171,13 @@ class CommandCSHalfOp : public Command
public:
CommandCSHalfOp() : Command("HALFOP", 1, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
if (!ircd->halfop)
{
return MOD_CONT;
}
return do_util(u, &csmodeutils[MUT_HALFOP], (params.size() > 0 ? params[0].c_str() : NULL), (params.size() > 1 ? params[1].c_str() : NULL));
@@ -207,10 +201,9 @@ class CommandCSDeHalfOp : public Command
public:
CommandCSDeHalfOp() : Command("DEHALFOP", 1, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
if (!ircd->halfop)
{
@@ -238,10 +231,9 @@ class CommandCSProtect : public Command
public:
CommandCSProtect() : Command("PROTECT", 1, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
if (!ircd->protect && !ircd->admin)
{
@@ -270,10 +262,9 @@ class CommandCSDeProtect : public Command
public:
CommandCSDeProtect() : Command("DEPROTECT", 1, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
if (!ircd->protect && !ircd->admin)
{
@@ -302,10 +293,9 @@ class CommandCSOwner : public Command
public:
CommandCSOwner() : Command("OWNER", 1, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return do_util(u, &csmodeutils[MUT_OWNER], (params.size() > 0 ? params[0].c_str() : NULL), NULL);
}
@@ -329,10 +319,9 @@ class CommandCSDeOwner : public Command
public:
CommandCSDeOwner() : Command("DEOWNER", 1, 2)
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return do_util(u, &csmodeutils[MUT_DEOWNER], (params.size() > 0 ? params[0].c_str() : NULL), NULL);
}
+1 -2
View File
@@ -23,7 +23,7 @@ class CommandCSRegister : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL);
}
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 *pass = params[1].c_str();
@@ -70,7 +70,6 @@ class CommandCSRegister : public Command
{
alog("%s: makechan() failed for REGISTER %s", s_ChanServ, chan);
notice_lang(s_ChanServ, u, CHAN_REGISTRATION_FAILED);
}
else if (strscpy(founderpass, pass, PASSMAX), enc_encrypt_in_place(founderpass, PASSMAX) < 0)
{
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandCSSendPass : 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();
ChannelInfo *ci = cs_findchan(chan);
+28 -32
View File
@@ -552,10 +552,10 @@ class CommandCSSet : 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 *cmd = params[1].c_str();
ci::string cmd = params[1];
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
ChannelInfo *ci = cs_findchan(chan);
bool is_servadmin = u->nc->HasPriv("chanserv/set");
@@ -565,15 +565,11 @@ class CommandCSSet : public Command
return MOD_CONT;
}
if (!param && (!cmd || (stricmp(cmd, "SUCCESSOR") != 0 &&
stricmp(cmd, "URL") != 0 &&
stricmp(cmd, "EMAIL") != 0 &&
stricmp(cmd, "ENTRYMSG") != 0) &&
stricmp(cmd, "MLOCK") != 0)) {
if (!param && cmd != "SUCCESSOR" && cmd != "URL" && cmd != "EMAIL" && cmd != "ENTRYMSG" && cmd != "MLOCK")
syntax_error(s_ChanServ, u, "SET", CHAN_SET_SYNTAX);
} else if (!is_servadmin && !check_access(u, ci, CA_SET)) {
else if (!is_servadmin && !check_access(u, ci, CA_SET))
notice_lang(s_ChanServ, u, ACCESS_DENIED);
} else if (stricmp(cmd, "FOUNDER") == 0) {
else if (cmd == "FOUNDER") {
if (!is_servadmin
&& (ci->
flags & CI_SECUREFOUNDER ? !is_real_founder(u,
@@ -583,7 +579,7 @@ class CommandCSSet : public Command
} else {
DoSetFounder(u, ci, param);
}
} else if (stricmp(cmd, "SUCCESSOR") == 0) {
} else if (cmd == "SUCCESSOR") {
if (!is_servadmin
&& (ci->
flags & CI_SECUREFOUNDER ? !is_real_founder(u,
@@ -593,7 +589,7 @@ class CommandCSSet : public Command
} else {
DoSetSuccessor(u, ci, param);
}
} else if (stricmp(cmd, "PASSWORD") == 0) {
} else if (cmd == "PASSWORD") {
if (!is_servadmin
&& (ci->
flags & CI_SECUREFOUNDER ? !is_real_founder(u,
@@ -603,29 +599,29 @@ class CommandCSSet : public Command
} else {
DoSetPassword(u, ci, param);
}
} else if (stricmp(cmd, "DESC") == 0) {
} else if (cmd == "DESC") {
DoSetDesc(u, ci, param);
} else if (stricmp(cmd, "URL") == 0) {
} else if (cmd == "URL") {
DoSetURL(u, ci, param);
} else if (stricmp(cmd, "EMAIL") == 0) {
} else if (cmd == "EMAIL") {
DoSetEMail(u, ci, param);
} else if (stricmp(cmd, "ENTRYMSG") == 0) {
} else if (cmd == "ENTRYMSG") {
DoSetEntryMsg(u, ci, param);
} else if (stricmp(cmd, "TOPIC") == 0) {
} else if (cmd == "TOPIC") {
notice_lang(s_ChanServ, u, OBSOLETE_COMMAND, "TOPIC");
} else if (stricmp(cmd, "BANTYPE") == 0) {
} else if (cmd == "BANTYPE") {
DoSetBanType(u, ci, param);
} else if (stricmp(cmd, "MLOCK") == 0) {
} else if (cmd == "MLOCK") {
DoSetMLock(u, ci, param);
} else if (stricmp(cmd, "KEEPTOPIC") == 0) {
} else if (cmd == "KEEPTOPIC") {
DoSetKeepTopic(u, ci, param);
} else if (stricmp(cmd, "TOPICLOCK") == 0) {
} else if (cmd == "TOPICLOCK") {
DoSetTopicLock(u, ci, param);
} else if (stricmp(cmd, "PRIVATE") == 0) {
} else if (cmd == "PRIVATE") {
DoSetPrivate(u, ci, param);
} else if (stricmp(cmd, "SECUREOPS") == 0) {
} else if (cmd == "SECUREOPS") {
DoSetSecureOps(u, ci, param);
} else if (stricmp(cmd, "SECUREFOUNDER") == 0) {
} else if (cmd == "SECUREFOUNDER") {
if (!is_servadmin
&& (ci->
flags & CI_SECUREFOUNDER ? !is_real_founder(u,
@@ -635,26 +631,26 @@ class CommandCSSet : public Command
} else {
DoSetSecureFounder(u, ci, param);
}
} else if (stricmp(cmd, "RESTRICTED") == 0) {
} else if (cmd == "RESTRICTED") {
DoSetRestricted(u, ci, param);
} else if (stricmp(cmd, "SECURE") == 0) {
} else if (cmd == "SECURE") {
DoSetSecure(u, ci, param);
} else if (stricmp(cmd, "SIGNKICK") == 0) {
} else if (cmd == "SIGNKICK") {
DoSetSignKick(u, ci, param);
} else if (stricmp(cmd, "OPNOTICE") == 0) {
} else if (cmd == "OPNOTICE") {
DoSetOpNotice(u, ci, param);
} else if (stricmp(cmd, "XOP") == 0) {
} else if (cmd == "XOP") {
if (!(findModule("cs_xop"))) {
notice_lang(s_ChanServ, u, CHAN_XOP_NOT_AVAILABLE, cmd);
notice_lang(s_ChanServ, u, CHAN_XOP_NOT_AVAILABLE, cmd.c_str());
} else {
DoSetXOP(u, ci, param);
}
} else if (stricmp(cmd, "PEACE") == 0) {
} else if (cmd == "PEACE") {
DoSetPeace(u, ci, param);
} else if (stricmp(cmd, "NOEXPIRE") == 0) {
} else if (cmd == "NOEXPIRE") {
DoSetNoExpire(u, ci, param);
} else {
notice_lang(s_ChanServ, u, CHAN_SET_UNKNOWN_OPTION, cmd);
notice_lang(s_ChanServ, u, CHAN_SET_UNKNOWN_OPTION, cmd.c_str());
notice_lang(s_ChanServ, u, MORE_INFO, s_ChanServ, "SET");
}
return MOD_CONT;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandCSStatus : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
ChannelInfo *ci;
User *u2;
+2 -2
View File
@@ -22,7 +22,7 @@ class CommandCSSuspend : 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 *reason = params.size() > 1 ? params[1].c_str() : NULL;
@@ -116,7 +116,7 @@ class CommandCSUnSuspend : public Command
this->SetFlag(CFLAG_ALLOW_SUSPENDED);
}
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();
ChannelInfo *ci = cs_findchan(chan);
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandCSTopic : 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 *topic = params.size() > 1 ? params[1].c_str() : NULL;
+15 -15
View File
@@ -104,7 +104,7 @@ int xop_msgs[XOP_TYPES][XOP_MESSAGES] = {
class XOPBase : public Command
{
private:
CommandReturn DoAdd(User *u, std::vector<std::string> &params, ChannelInfo *ci, int level, int *messages)
CommandReturn DoAdd(User *u, std::vector<ci::string> &params, ChannelInfo *ci, int level, int *messages)
{
const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
ChanAccess *access;
@@ -187,7 +187,7 @@ class XOPBase : public Command
return MOD_CONT;
}
CommandReturn DoDel(User *u, std::vector<std::string> &params, ChannelInfo *ci, int level, int *messages)
CommandReturn DoDel(User *u, std::vector<ci::string> &params, ChannelInfo *ci, int level, int *messages)
{
const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
ChanAccess *access;
@@ -286,7 +286,7 @@ class XOPBase : public Command
return MOD_CONT;
}
CommandReturn DoList(User *u, std::vector<std::string> &params, ChannelInfo *ci, int level, int *messages)
CommandReturn DoList(User *u, std::vector<ci::string> &params, ChannelInfo *ci, int level, int *messages)
{
int sent_header = 0;
const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
@@ -321,7 +321,7 @@ class XOPBase : public Command
return MOD_CONT;
}
CommandReturn DoClear(User *u, std::vector<std::string> &params, ChannelInfo *ci, int level, int *messages)
CommandReturn DoClear(User *u, std::vector<ci::string> &params, ChannelInfo *ci, int level, int *messages)
{
if (readonly)
{
@@ -355,22 +355,22 @@ class XOPBase : public Command
return MOD_CONT;
}
protected:
CommandReturn DoXop(User *u, std::vector<std::string> &params, int level, int *messages)
CommandReturn DoXop(User *u, std::vector<ci::string> &params, int level, int *messages)
{
const char *chan = params[0].c_str();
const char *cmd = params[1].c_str();
ci::string cmd = params[1];
ChannelInfo *ci = cs_findchan(chan);
if (!(ci->flags & CI_XOP))
notice_lang(s_ChanServ, u, CHAN_XOP_ACCESS, s_ChanServ);
else if (!stricmp(cmd, "ADD"))
else if (cmd == "ADD")
return this->DoAdd(u, params, ci, level, messages);
else if (!stricmp(cmd, "DEL"))
else if (cmd == "DEL")
return this->DoDel(u, params, ci, level, messages);
else if (!stricmp(cmd, "LIST"))
else if (cmd == "LIST")
return this->DoList(u, params, ci, level, messages);
else if (!stricmp(cmd, "CLEAR"))
else if (cmd == "CLEAR")
return this->DoClear(u, params, ci, level, messages);
else
this->OnSyntaxError(u);
@@ -385,7 +385,7 @@ class XOPBase : public Command
{
}
virtual CommandReturn Execute(User *u, std::vector<std::string> &params) = 0;
virtual CommandReturn Execute(User *u, std::vector<ci::string> &params) = 0;
virtual bool OnHelp(User *u, const ci::string &subcommand) = 0;
@@ -399,7 +399,7 @@ class CommandCSAOP : public XOPBase
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return this->DoXop(u, params, ACCESS_AOP, xop_msgs[XOP_AOP]);
}
@@ -423,7 +423,7 @@ class CommandCSHOP : public XOPBase
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return this->DoXop(u, params, ACCESS_HOP, xop_msgs[XOP_HOP]);
}
@@ -447,7 +447,7 @@ class CommandCSSOP : public XOPBase
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return this->DoXop(u, params, ACCESS_SOP, xop_msgs[XOP_SOP]);
}
@@ -471,7 +471,7 @@ class CommandCSVOP : public XOPBase
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return this->DoXop(u, params, ACCESS_VOP, xop_msgs[XOP_VOP]);
}
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandHSDel : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickAlias *na;
const char *nick = params[0].c_str();
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandHSDelAll : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
int i;
const char *nick = params[0].c_str();
+1 -1
View File
@@ -24,7 +24,7 @@ class CommandHSGroup : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickAlias *na;
HostCore *tmp;
+2 -2
View File
@@ -23,9 +23,9 @@ class CommandHSHelp : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
mod_help_cmd(s_HostServ, u, HOSTSERV, params.size() > 0 ? params[0].c_str() : NULL);
mod_help_cmd(s_HostServ, u, HOSTSERV, params[0].c_str());
return MOD_CONT;
}
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandHSList : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *key = params.size() ? params[0].c_str() : NULL;
struct tm *tm;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandHSOff : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickAlias *na;
char *vhost;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandHSOn : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickAlias *na;
char *vHost;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandHSSet : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
const char *rawhostmask = params[1].c_str();
+1 -1
View File
@@ -24,7 +24,7 @@ class CommandHSSetAll : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
const char *rawhostmask = params[1].c_str();
+1 -1
View File
@@ -24,7 +24,7 @@ class CommandMSCancel : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
int ischan;
int isforbid;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandMSCheck : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickAlias *na = NULL;
MemoInfo *mi = NULL;
+15 -15
View File
@@ -24,23 +24,23 @@ class CommandMSDel : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
MemoInfo *mi;
ChannelInfo *ci;
const char *numstr = params.size() ? params[0].c_str() : NULL, *chan = NULL;
ci::string numstr = params.size() ? params[0] : "", chan;
int last, last0, i;
char buf[BUFSIZE], *end;
int delcount, count, left;
if (numstr && *numstr == '#')
if (!numstr.empty() && numstr[0] == '#')
{
chan = numstr;
numstr = params.size() > 1 ? params[1].c_str() : NULL;
numstr = params.size() > 1 ? params[1] : "";
if (!(ci = cs_findchan(chan)))
if (!(ci = cs_findchan(chan.c_str())))
{
notice_lang(s_MemoServ, u, CHAN_X_NOT_REGISTERED, chan);
notice_lang(s_MemoServ, u, CHAN_X_NOT_REGISTERED, chan.c_str());
return MOD_CONT;
}
else if (readonly)
@@ -59,25 +59,25 @@ class CommandMSDel : public Command
{
mi = &u->nc->memos;
}
if (!numstr || (!isdigit(*numstr) && stricmp(numstr, "ALL") && stricmp(numstr, "LAST")))
if (numstr.empty() || (!isdigit(numstr[0]) && numstr != "ALL" && numstr != "LAST"))
this->OnSyntaxError(u);
else if (mi->memos.empty())
{
if (chan)
notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan);
if (!chan.empty())
notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan.c_str());
else
notice_lang(s_MemoServ, u, MEMO_HAVE_NO_MEMOS);
}
else
{
if (isdigit(*numstr))
if (isdigit(numstr[0]))
{
/* Delete a specific memo or memos. */
last = -1; /* Last memo deleted */
last0 = -1; /* Beginning of range of last memos deleted */
end = buf;
left = sizeof(buf);
delcount = process_numlist(numstr, &count, del_memo_callback, u, mi, &last, &last0, &end, &left);
delcount = process_numlist(numstr.c_str(), &count, del_memo_callback, u, mi, &last, &last0, &end, &left);
if (last != -1)
{
/* Some memos got deleted; tell them which ones. */
@@ -97,12 +97,12 @@ class CommandMSDel : public Command
{
/* No memos were deleted. Tell them so. */
if (count == 1)
notice_lang(s_MemoServ, u, MEMO_DOES_NOT_EXIST, atoi(numstr));
notice_lang(s_MemoServ, u, MEMO_DOES_NOT_EXIST, atoi(numstr.c_str()));
else
notice_lang(s_MemoServ, u, MEMO_DELETED_NONE);
}
}
else if (!stricmp(numstr, "LAST"))
else if (numstr == "LAST")
{
/* Delete last memo. */
for (i = 0; i < mi->memos.size(); ++i)
@@ -119,8 +119,8 @@ class CommandMSDel : public Command
delete mi->memos[i];
}
mi->memos.clear();
if (chan)
notice_lang(s_MemoServ, u, MEMO_CHAN_DELETED_ALL, chan);
if (!chan.empty())
notice_lang(s_MemoServ, u, MEMO_CHAN_DELETED_ALL, chan.c_str());
else
notice_lang(s_MemoServ, u, MEMO_DELETED_ALL);
}
+2 -2
View File
@@ -23,9 +23,9 @@ class CommandMSHelp : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
mod_help_cmd(s_MemoServ, u, MEMOSERV, params.size() > 0 ? params[0].c_str() : NULL);
mod_help_cmd(s_MemoServ, u, MEMOSERV, params[0].c_str());
return MOD_CONT;
}
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandMSInfo : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
MemoInfo *mi;
NickAlias *na = NULL;
+16 -18
View File
@@ -25,22 +25,21 @@ class CommandMSList : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *param = params.size() ? params[0].c_str() : NULL, *chan = NULL;
ci::string param = params.size() ? params[0] : "", chan;
ChannelInfo *ci;
MemoInfo *mi;
Memo *m;
int i;
if (param && *param == '#')
if (!param.empty() && param[0] == '#')
{
chan = param;
param = params.size() > 1 ? params[1].c_str() : NULL;
param = params.size() > 1 ? params[1] : "";
if (!(ci = cs_findchan(chan)))
if (!(ci = cs_findchan(chan.c_str())))
{
notice_lang(s_MemoServ, u, CHAN_X_NOT_REGISTERED, chan);
notice_lang(s_MemoServ, u, CHAN_X_NOT_REGISTERED, chan.c_str());
return MOD_CONT;
}
else if (!check_access(u, ci, CA_MEMO))
@@ -54,24 +53,23 @@ class CommandMSList : public Command
{
mi = &u->nc->memos;
}
if (param && !isdigit(*param) && stricmp(param, "NEW"))
if (!param.empty() && !isdigit(param[0]) && param != "NEW")
this->OnSyntaxError(u);
else if (!mi->memos.size())
{
if (chan)
notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan);
if (!chan.empty())
notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan.c_str());
else
notice_lang(s_MemoServ, u, MEMO_HAVE_NO_MEMOS);
}
else
{
int sent_header = 0;
if (param && isdigit(*param))
process_numlist(param, NULL, list_memo_callback, u,
mi, &sent_header, chan);
if (!param.empty() && isdigit(param[0]))
process_numlist(param.c_str(), NULL, list_memo_callback, u, mi, &sent_header, chan.c_str());
else
{
if (param)
if (!param.empty())
{
for (i = 0; i < mi->memos.size(); ++i)
{
@@ -80,8 +78,8 @@ class CommandMSList : public Command
}
if (i == mi->memos.size())
{
if (chan)
notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_NEW_MEMOS, chan);
if (!chan.empty())
notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_NEW_MEMOS, chan.c_str());
else
notice_lang(s_MemoServ, u, MEMO_HAVE_NO_NEW_MEMOS);
return MOD_CONT;
@@ -89,9 +87,9 @@ class CommandMSList : public Command
}
for (i = 0; i < mi->memos.size(); ++i)
{
if (param && !(mi->memos[i]->flags & MF_UNREAD))
if (!param.empty() && !(mi->memos[i]->flags & MF_UNREAD))
continue;
list_memo(u, i, mi, &sent_header, param != NULL, chan);
list_memo(u, i, mi, &sent_header, !param.empty(), chan.c_str());
}
}
}
+18 -18
View File
@@ -26,21 +26,21 @@ class CommandMSRead : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
MemoInfo *mi;
ChannelInfo *ci;
const char *numstr = params.size() ? params[0].c_str() : NULL, *chan = NULL;
ci::string numstr = params.size() ? params[0] : "", chan;
int num, count;
if (numstr && *numstr == '#')
if (!numstr.empty() && numstr[0] == '#')
{
chan = numstr;
numstr = params.size() > 1 ? params[1].c_str() : NULL;
numstr = params.size() > 1 ? params[1] : "";
if (!(ci = cs_findchan(chan)))
if (!(ci = cs_findchan(chan.c_str())))
{
notice_lang(s_MemoServ, u, CHAN_X_NOT_REGISTERED, chan);
notice_lang(s_MemoServ, u, CHAN_X_NOT_REGISTERED, chan.c_str());
return MOD_CONT;
}
else if (!check_access(u, ci, CA_MEMO))
@@ -54,51 +54,51 @@ class CommandMSRead : public Command
{
mi = &u->nc->memos;
}
num = numstr ? atoi(numstr) : -1;
if (!numstr || (stricmp(numstr, "LAST") && stricmp(numstr, "NEW") && num <= 0))
num = !numstr.empty() ? atoi(numstr.c_str()) : -1;
if (numstr.empty() || (numstr != "LAST" && numstr != "NEW" && num <= 0))
this->OnSyntaxError(u);
else if (mi->memos.empty())
{
if (chan)
notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan);
if (!chan.empty())
notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan.c_str());
else
notice_lang(s_MemoServ, u, MEMO_HAVE_NO_MEMOS);
}
else {
int i;
if (!stricmp(numstr, "NEW"))
if (numstr == "NEW")
{
int readcount = 0;
for (i = 0; i < mi->memos.size(); ++i)
{
if (mi->memos[i]->flags & MF_UNREAD)
{
read_memo(u, i, mi, chan);
read_memo(u, i, mi, chan.c_str());
++readcount;
}
}
if (!readcount)
{
if (chan)
notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_NEW_MEMOS, chan);
if (!chan.empty())
notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_NEW_MEMOS, chan.c_str());
else
notice_lang(s_MemoServ, u, MEMO_HAVE_NO_NEW_MEMOS);
}
}
else if (!stricmp(numstr, "LAST"))
else if (numstr == "LAST")
{
for (i = 0; i < mi->memos.size() - 1; ++i);
read_memo(u, i, mi, chan);
read_memo(u, i, mi, chan.c_str());
}
else /* number[s] */
{
if (!process_numlist(numstr, &count, read_memo_callback, u, mi, chan))
if (!process_numlist(numstr.c_str(), &count, read_memo_callback, u, mi, chan.c_str()))
{
if (count == 1)
notice_lang(s_MemoServ, u, MEMO_DOES_NOT_EXIST, num);
else
notice_lang(s_MemoServ, u, MEMO_LIST_NOT_FOUND, numstr);
notice_lang(s_MemoServ, u, MEMO_LIST_NOT_FOUND, numstr.c_str());
}
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandMSRSend : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
const char *text = params[1].c_str();
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandMSSend : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
const char *text = params[1].c_str();
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandMSSendAll : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
int i, z = 1;
NickCore *nc;
+46 -47
View File
@@ -18,28 +18,28 @@
class CommandMSSet : public Command
{
private:
CommandReturn DoNotify(User *u, std::vector<std::string> &params, MemoInfo *mi)
CommandReturn DoNotify(User *u, std::vector<ci::string> &params, MemoInfo *mi)
{
const char *param = params[1].c_str();
ci::string param = params[1];
if (!stricmp(param, "ON"))
if (param == "ON")
{
u->nc->flags |= NI_MEMO_SIGNON | NI_MEMO_RECEIVE;
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_ON, s_MemoServ);
}
else if (!stricmp(param, "LOGON"))
else if (param == "LOGON")
{
u->nc->flags |= NI_MEMO_SIGNON;
u->nc->flags &= ~NI_MEMO_RECEIVE;
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_LOGON, s_MemoServ);
}
else if (!stricmp(param, "NEW"))
else if (param == "NEW")
{
u->nc->flags &= ~NI_MEMO_SIGNON;
u->nc->flags |= NI_MEMO_RECEIVE;
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_NEW, s_MemoServ);
}
else if (!stricmp(param, "MAIL"))
else if (param == "MAIL")
{
if (u->nc->email)
{
@@ -49,12 +49,12 @@ class CommandMSSet : public Command
else
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_INVALIDMAIL);
}
else if (!stricmp(param, "NOMAIL"))
else if (param == "NOMAIL")
{
u->nc->flags &= ~NI_MEMO_MAIL;
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_NOMAIL);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
u->nc->flags &= ~(NI_MEMO_SIGNON | NI_MEMO_RECEIVE | NI_MEMO_MAIL);
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_OFF, s_MemoServ);
@@ -64,26 +64,26 @@ class CommandMSSet : public Command
return MOD_CONT;
}
CommandReturn DoLimit(User *u, std::vector<std::string> &params, MemoInfo *mi)
CommandReturn DoLimit(User *u, std::vector<ci::string> &params, MemoInfo *mi)
{
const char *p1 = params[1].c_str();
const char *p2 = params.size() > 2 ? params[2].c_str() : NULL;
const char *p3 = params.size() > 3 ? params[3].c_str() : NULL;
const char *user = NULL, *chan = NULL;
ci::string p1 = params[1];
ci::string p2 = params.size() > 2 ? params[2] : "";
ci::string p3 = params.size() > 3 ? params[3] : "";
ci::string user, chan;
int32 limit;
NickCore *nc = u->nc;
ChannelInfo *ci = NULL;
bool is_servadmin = u->nc->HasPriv("memoserv/set-limit");
if (*p1 == '#')
if (p1[0] == '#')
{
chan = p1;
p1 = p2;
p2 = p3;
p3 = params.size() > 4 ? params[4].c_str() : NULL;
if (!(ci = cs_findchan(chan)))
p3 = params.size() > 4 ? params[4] : "";
if (!(ci = cs_findchan(chan.c_str())))
{
notice_lang(s_MemoServ, u, CHAN_X_NOT_REGISTERED, chan);
notice_lang(s_MemoServ, u, CHAN_X_NOT_REGISTERED, chan.c_str());
return MOD_CONT;
}
else if (!is_servadmin && !check_access(u, ci, CA_MEMO))
@@ -95,12 +95,12 @@ class CommandMSSet : public Command
}
if (is_servadmin)
{
if (p2 && stricmp(p2, "HARD") && !chan)
if (!p2.empty() && p2 != "HARD" && chan.empty())
{
NickAlias *na;
if (!(na = findnick(p1)))
if (!(na = findnick(p1.c_str())))
{
notice_lang(s_MemoServ, u, NICK_X_NOT_REGISTERED, p1);
notice_lang(s_MemoServ, u, NICK_X_NOT_REGISTERED, p1.c_str());
return MOD_CONT;
}
user = p1;
@@ -109,61 +109,62 @@ class CommandMSSet : public Command
p1 = p2;
p2 = p3;
}
else if (!p1)
else if (p1.empty())
{
syntax_error(s_MemoServ, u, "SET LIMIT", MEMO_SET_LIMIT_SERVADMIN_SYNTAX);
return MOD_CONT;
}
if ((!isdigit(*p1) && stricmp(p1, "NONE")) || (p2 && stricmp(p2, "HARD")))
if ((!isdigit(p1[0]) && p1 != "NONE") || (!p2.empty() && p2 != "HARD"))
{
syntax_error(s_MemoServ, u, "SET LIMIT", MEMO_SET_LIMIT_SERVADMIN_SYNTAX);
return MOD_CONT;
}
if (chan)
if (!chan.empty())
{
if (p2)
if (!p2.empty())
ci->flags |= CI_MEMO_HARDMAX;
else
ci->flags &= ~CI_MEMO_HARDMAX;
}
else
{
if (p2)
if (!p2.empty())
nc->flags |= NI_MEMO_HARDMAX;
else
nc->flags &= ~NI_MEMO_HARDMAX;
}
limit = atoi(p1);
limit = atoi(p1.c_str());
if (limit < 0 || limit > 32767)
{
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_OVERFLOW, 32767);
limit = 32767;
}
if (stricmp(p1, "NONE") == 0)
if (p1 == "NONE")
limit = -1;
}
else
{
if (!p1 || p2 || !isdigit(*p1)) {
if (p1.empty() || !p2.empty() || !isdigit(p1[0])) {
syntax_error(s_MemoServ, u, "SET LIMIT", MEMO_SET_LIMIT_SYNTAX);
return MOD_CONT;
}
if (chan && (ci->flags & CI_MEMO_HARDMAX))
if (!chan.empty() && (ci->flags & CI_MEMO_HARDMAX))
{
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_FORBIDDEN, chan);
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_FORBIDDEN, chan.c_str());
return MOD_CONT;
}
else if (!chan && (nc->flags & NI_MEMO_HARDMAX)) {
else if (chan.empty() && (nc->flags & NI_MEMO_HARDMAX))
{
notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT_FORBIDDEN);
return MOD_CONT;
}
limit = atoi(p1);
limit = atoi(p1.c_str());
/* The first character is a digit, but we could still go negative
* from overflow... watch out! */
if (limit < 0 || (MSMaxMemos > 0 && limit > MSMaxMemos))
{
if (chan)
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_TOO_HIGH, chan, MSMaxMemos);
if (!chan.empty())
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_TOO_HIGH, chan.c_str(), MSMaxMemos);
else
notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT_TOO_HIGH, MSMaxMemos);
return MOD_CONT;
@@ -177,25 +178,24 @@ class CommandMSSet : public Command
mi->memomax = limit;
if (limit > 0)
{
if (!chan && nc == u->nc)
if (chan.empty() && nc == u->nc)
notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT, limit);
else
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT, chan ? chan : user, limit);
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT, !chan.empty() ? chan.c_str() : user.c_str(), limit);
}
else if (!limit)
{
if (!chan && nc == u->nc)
if (chan.empty() && nc == u->nc)
notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT_ZERO);
else
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_ZERO, chan ? chan : user);
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_ZERO, !chan.empty() ? chan.c_str() : user.c_str());
}
else
{
if (!chan && nc == u->nc)
if (chan.empty() && nc == u->nc)
notice_lang(s_MemoServ, u, MEMO_UNSET_YOUR_LIMIT);
else
notice_lang(s_MemoServ, u, MEMO_UNSET_LIMIT,
chan ? chan : user);
notice_lang(s_MemoServ, u, MEMO_UNSET_LIMIT, !chan.empty() ? chan.c_str() : user.c_str());
}
return MOD_CONT;
}
@@ -204,9 +204,9 @@ class CommandMSSet : 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];
MemoInfo *mi = &u->nc->memos;
if (readonly)
@@ -214,14 +214,13 @@ class CommandMSSet : public Command
notice_lang(s_MemoServ, u, MEMO_SET_DISABLED);
return MOD_CONT;
}
else if (!stricmp(cmd, "NOTIFY"))
else if (cmd == "NOTIFY")
return this->DoNotify(u, params, mi);
else if (!stricmp(cmd, "LIMIT")) {
else if (cmd == "LIMIT")
return this->DoLimit(u, params, mi);
}
else
{
notice_lang(s_MemoServ, u, MEMO_SET_UNKNOWN_OPTION, cmd);
notice_lang(s_MemoServ, u, MEMO_SET_UNKNOWN_OPTION, cmd.c_str());
notice_lang(s_MemoServ, u, MORE_INFO, s_MemoServ, "SET");
}
return MOD_CONT;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandMSStaff : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickCore *nc;
int i, z = 0;
+13 -13
View File
@@ -18,7 +18,7 @@
class CommandNSAccess : public Command
{
private:
CommandReturn DoServAdminList(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoServAdminList(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *mask = params.size() > 2 ? params[2].c_str() : NULL;
unsigned i;
@@ -55,7 +55,7 @@ class CommandNSAccess : public Command
return MOD_CONT;
}
CommandReturn DoAdd(User *u, std::vector<std::string> &params, NickCore *nc, const char *mask)
CommandReturn DoAdd(User *u, NickCore *nc, const char *mask)
{
if (!mask)
{
@@ -81,7 +81,7 @@ class CommandNSAccess : public Command
return MOD_CONT;
}
CommandReturn DoDel(User *u, std::vector<std::string> &params, NickCore *nc, const char *mask)
CommandReturn DoDel(User *u, NickCore *nc, const char *mask)
{
if (!mask)
{
@@ -101,7 +101,7 @@ class CommandNSAccess : public Command
return MOD_CONT;
}
CommandReturn DoList(User *u, std::vector<std::string> &params, NickCore *nc, const char *mask)
CommandReturn DoList(User *u, NickCore *nc, const char *mask)
{
unsigned i;
@@ -127,13 +127,13 @@ class CommandNSAccess : 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];
const char *mask = params.size() > 1 ? params[1].c_str() : NULL;
NickAlias *na;
if (!stricmp(cmd, "LIST") && u->nc->IsServicesOper() && mask && (na = findnick(params[1].c_str())))
if (cmd == "LIST" && u->nc->IsServicesOper() && mask && (na = findnick(params[1].c_str())))
return this->DoServAdminList(u, params, na->nc);
if (mask && !strchr(mask, '@'))
@@ -148,12 +148,12 @@ class CommandNSAccess : public Command
*/
else if (u->nc->flags & NI_SUSPENDED)
notice_lang(s_NickServ, u, NICK_X_SUSPENDED, u->nc->display);
else if (!stricmp(cmd, "ADD"))
return this->DoAdd(u, params, u->nc, mask);
else if (!stricmp(cmd, "DEL"))
return this->DoDel(u, params, u->nc, mask);
else if (!stricmp(cmd, "LIST"))
return this->DoList(u, params, u->nc, mask);
else if (cmd == "ADD")
return this->DoAdd(u, u->nc, mask);
else if (cmd == "DEL")
return this->DoDel(u, u->nc, mask);
else if (cmd == "LIST")
return this->DoList(u, u->nc, mask);
else
this->OnSyntaxError(u);
return MOD_CONT;
+10 -10
View File
@@ -22,7 +22,7 @@ class CommandNSAList : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
/*
* List the channels that the given nickname has access on
@@ -34,7 +34,6 @@ class CommandNSAList : public Command
*/
const char *nick = NULL;
const char *lev = NULL;
NickAlias *na;
@@ -63,22 +62,23 @@ class CommandNSAList : public Command
}
/* If available, get level from arguments */
lev = params.size() > lev_param ? params[lev_param].c_str() : NULL;
ci::string lev = params.size() > lev_param ? params[lev_param] : "";
/* if a level was given, make sure it's an int for later */
if (lev) {
if (!stricmp(lev, "FOUNDER"))
if (!lev.empty())
{
if (lev == "FOUNDER")
min_level = ACCESS_FOUNDER;
else if (!stricmp(lev, "SOP"))
else if (lev == "SOP")
min_level = ACCESS_SOP;
else if (!stricmp(lev, "AOP"))
else if (lev == "AOP")
min_level = ACCESS_AOP;
else if (!stricmp(lev, "HOP"))
else if (lev == "HOP")
min_level = ACCESS_HOP;
else if (!stricmp(lev, "VOP"))
else if (lev == "VOP")
min_level = ACCESS_VOP;
else
min_level = atoi(lev);
min_level = atoi(lev.c_str());
}
if (!na)
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandNSDrop : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params.size() ? params[0].c_str() : NULL;
NickAlias *na;
+1 -1
View File
@@ -24,7 +24,7 @@ class CommandNSForbid : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickAlias *na;
const char *nick = params[0].c_str();
+6 -6
View File
@@ -27,30 +27,30 @@ class CommandNSGetEMail : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *email = params[0].c_str();
ci::string email = params[0];
int i, j = 0;
NickCore *nc;
alog("%s: %s!%s@%s used GETEMAIL on %s", s_NickServ, u->nick, u->GetIdent().c_str(), u->host, email);
alog("%s: %s!%s@%s used GETEMAIL on %s", s_NickServ, u->nick, u->GetIdent().c_str(), u->host, email.c_str());
for (i = 0; i < 1024; ++i)
{
for (nc = nclists[i]; nc; nc = nc->next)
{
if (nc->email)
{
if (!stricmp(nc->email, email))
if (nc->email == email)
{
++j;
notice_lang(s_NickServ, u, NICK_GETEMAIL_EMAILS_ARE, nc->display, email);
notice_lang(s_NickServ, u, NICK_GETEMAIL_EMAILS_ARE, nc->display, email.c_str());
}
}
}
}
if (j <= 0)
{
notice_lang(s_NickServ, u, NICK_GETEMAIL_NOT_USED, email);
notice_lang(s_NickServ, u, NICK_GETEMAIL_NOT_USED, email.c_str());
return MOD_CONT;
}
return MOD_CONT;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandNSGetPass : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
char tmp_pass[PASSMAX];
+1 -1
View File
@@ -23,7 +23,7 @@ class CommandNSGhost : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
const char *pass = params.size() > 1 ? params[1].c_str() : NULL;
+2 -2
View File
@@ -25,7 +25,7 @@ class CommandNSGroup : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickAlias *na, *target;
NickCore *nc;
@@ -177,7 +177,7 @@ class CommandNSGList : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params.size() ? params[0].c_str() : NULL;
+4 -4
View File
@@ -23,11 +23,11 @@ class CommandNSHelp : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
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 (!stricmp(cmd, "SET LANGUAGE"))
if (cmd == "SET LANGUAGE")
{
int i;
notice_help(s_NickServ, u, NICK_HELP_SET_LANGUAGE);
@@ -35,7 +35,7 @@ class CommandNSHelp : public Command
u->SendMessage(s_NickServ, " %2d) %s", i + 1, langnames[langlist[i]]);
}
else
mod_help_cmd(s_NickServ, u, NICKSERV, cmd);
mod_help_cmd(s_NickServ, u, NICKSERV, cmd.c_str());
return MOD_CONT;
}
+1 -1
View File
@@ -26,7 +26,7 @@ class CommandNSIdentify : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *pass = params[0].c_str();
NickAlias *na;
+4 -4
View File
@@ -36,7 +36,7 @@ class CommandNSInfo : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
/* Show hidden info to nick owners and sadmins when the "ALL" parameter is
* supplied. If a nick is online, the "Last seen address" changes to "Is
@@ -45,7 +45,7 @@ class CommandNSInfo : public Command
* -TheShadow (13 Mar 1999)
*/
const char *nick = params[0].c_str();
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : "";
NickAlias *na;
NickRequest *nr = NULL;
@@ -56,7 +56,7 @@ class CommandNSInfo : public Command
if ((nr = findrequestnick(nick)))
{
notice_lang(s_NickServ, u, NICK_IS_PREREG);
if (param && !stricmp(param, "ALL") && u->nc && u->nc->IsServicesOper())
if (!param.empty() && param == "ALL" && u->nc && u->nc->IsServicesOper())
notice_lang(s_NickServ, u, NICK_INFO_EMAIL, nr->email);
else
{
@@ -90,7 +90,7 @@ class CommandNSInfo : public Command
/* Only show hidden fields to owner and sadmins and only when the ALL
* parameter is used. -TheShadow */
if (param && !stricmp(param, "ALL") && u->nc && (na->nc == u->nc || u->nc->IsServicesOper()))
if (!param.empty() && param == "ALL" && u->nc && (na->nc == u->nc || u->nc->IsServicesOper()))
show_hidden = 1;
notice_lang(s_NickServ, u, NICK_INFO_REALNAME, na->nick, na->last_realname);
+7 -6
View File
@@ -23,7 +23,7 @@ class CommandNSList : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
/* SADMINS can search for nicks based on their NS_FORBIDDEN and NS_NO_EXPIRE
* status. The keywords FORBIDDEN and NOEXPIRE represent these two states
@@ -104,16 +104,17 @@ class CommandNSList : public Command
if (is_servadmin && params.size() > 1)
{
std::string keyword;
spacesepstream keywords(params[1]);
spacesepstream keywords(params[1].c_str());
while (keywords.GetToken(keyword))
{
if (!stricmp(keyword.c_str(), "FORBIDDEN"))
ci::string keyword_ci = keyword.c_str();
if (keyword_ci == "FORBIDDEN")
matchflags |= NS_FORBIDDEN;
if (!stricmp(keyword.c_str(), "NOEXPIRE"))
if (keyword_ci == "NOEXPIRE")
matchflags |= NS_NO_EXPIRE;
if (!stricmp(keyword.c_str(), "SUSPENDED"))
if (keyword_ci == "SUSPENDED")
susp_keyword = 1;
if (!stricmp(keyword.c_str(), "UNCONFIRMED"))
if (keyword_ci == "UNCONFIRMED")
nronly = 1;
}
}
+3 -3
View File
@@ -25,10 +25,10 @@ class CommandNSLogout : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params.size() ? params[0].c_str() : NULL;
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : "";
User *u2;
NickAlias *na;
struct u_chaninfolist *ci, *ci2;
@@ -48,7 +48,7 @@ class CommandNSLogout : public Command
notice_lang(s_NickServ, u, NICK_LOGOUT_SERVICESADMIN, nick);
else
{
if (nick && param && !stricmp(param, "REVALIDATE"))
if (nick && !param.empty() && param == "REVALIDATE")
{
cancel_user(u2);
validate_user(u2);
+1 -1
View File
@@ -23,7 +23,7 @@ class CommandNSRecover : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
const char *pass = params.size() > 1 ? params[1].c_str() : NULL;
+5 -5
View File
@@ -106,7 +106,7 @@ class CommandNSConfirm : public Command
}
CommandReturn DoConfirm(User *u, std::vector<std::string> &params)
CommandReturn DoConfirm(User *u, std::vector<ci::string> &params)
{
NickRequest *nr = NULL;
const char *passcode = params.size() ? params[0].c_str() : NULL;
@@ -178,7 +178,7 @@ class CommandNSConfirm : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return this->DoConfirm(u, params);
}
@@ -198,7 +198,7 @@ class CommandNSRegister : public CommandNSConfirm
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickRequest *nr = NULL, *anr = NULL;
NickAlias *na;
@@ -323,7 +323,7 @@ class CommandNSRegister : public CommandNSConfirm
}
else
{
std::vector<std::string> empty_params;
std::vector<ci::string> empty_params;
return this->DoConfirm(u, empty_params);
}
}
@@ -354,7 +354,7 @@ class CommandNSResend : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickRequest *nr = NULL;
if (NSEmailReg)
+1 -1
View File
@@ -23,7 +23,7 @@ class CommandNSRelease : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
const char *pass = params.size() > 1 ? params[1].c_str() : NULL;
+77 -78
View File
@@ -18,13 +18,13 @@
class CommandNSSASet : public Command
{
private:
CommandReturn DoSetDisplay(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetDisplay(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
ci::string param = params.size() > 2 ? params[2] : "";
int i;
NickAlias *na;
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
@@ -34,7 +34,7 @@ private:
for (i = 0; i < nc->aliases.count; ++i)
{
na = static_cast<NickAlias *>(nc->aliases.list[i]);
if (!stricmp(na->nick, param))
if (na->nick == param)
{
param = na->nick; /* Because case may differ */
break;
@@ -47,22 +47,22 @@ private:
return MOD_CONT;
}
change_core_display(nc, param);
change_core_display(nc, param.c_str());
notice_lang(s_NickServ, u, NICK_SASET_DISPLAY_CHANGED, nc->display);
return MOD_CONT;
}
CommandReturn DoSetPassword(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetPassword(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
ci::string param = params.size() > 2 ? params[2] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
}
int len = strlen(param);
int len = param.size();
char tmp_pass[PASSMAX];
if (NSSecureAdmins && u->nc != nc && nc->IsServicesOper())
@@ -70,7 +70,7 @@ private:
notice_lang(s_NickServ, u, ACCESS_DENIED);
return MOD_CONT;
}
else if (!stricmp(nc->display, param) || (StrictPasswords && len < 5))
else if (nc->display == param || (StrictPasswords && len < 5))
{
notice_lang(s_NickServ, u, MORE_OBSCURE_PASSWORD);
return MOD_CONT;
@@ -81,7 +81,7 @@ private:
return MOD_CONT;
}
if (enc_encrypt(param, len, nc->pass, PASSMAX - 1) < 0)
if (enc_encrypt(param.c_str(), len, nc->pass, PASSMAX - 1) < 0)
{
params[2].clear();
alog("%s: Failed to encrypt password for %s (set)", s_NickServ, nc->display);
@@ -101,7 +101,7 @@ private:
return MOD_CONT;
}
CommandReturn DoSetUrl(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetUrl(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
@@ -121,7 +121,7 @@ private:
return MOD_CONT;
}
CommandReturn DoSetEmail(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetEmail(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
@@ -159,7 +159,7 @@ private:
return MOD_CONT;
}
CommandReturn DoSetICQ(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetICQ(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
@@ -171,8 +171,7 @@ private:
else
{
nc->icq = tmp;
notice_lang(s_NickServ, u, NICK_SASET_ICQ_CHANGED, nc->display,
param);
notice_lang(s_NickServ, u, NICK_SASET_ICQ_CHANGED, nc->display, param);
}
}
else
@@ -183,7 +182,7 @@ private:
return MOD_CONT;
}
CommandReturn DoSetGreet(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetGreet(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
@@ -208,29 +207,29 @@ private:
return MOD_CONT;
}
CommandReturn DoSetKill(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetKill(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
ci::string param = params.size() > 2 ? params[2] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
}
if (!stricmp(param, "ON"))
if (param == "ON")
{
nc->flags |= NI_KILLPROTECT;
nc->flags &= ~(NI_KILL_QUICK | NI_KILL_IMMED);
notice_lang(s_NickServ, u, NICK_SASET_KILL_ON, nc->display);
}
else if (!stricmp(param, "QUICK"))
else if (param == "QUICK")
{
nc->flags |= NI_KILLPROTECT | NI_KILL_QUICK;
nc->flags &= ~NI_KILL_IMMED;
notice_lang(s_NickServ, u, NICK_SASET_KILL_QUICK, nc->display);
}
else if (!stricmp(param, "IMMED"))
else if (param == "IMMED")
{
if (NSAllowKillImmed)
{
@@ -241,7 +240,7 @@ private:
else
notice_lang(s_NickServ, u, NICK_SASET_KILL_IMMED_DISABLED);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags &= ~(NI_KILLPROTECT | NI_KILL_QUICK | NI_KILL_IMMED);
notice_lang(s_NickServ, u, NICK_SASET_KILL_OFF, nc->display);
@@ -251,22 +250,22 @@ private:
return MOD_CONT;
}
CommandReturn DoSetSecure(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetSecure(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
ci::string param = params.size() > 2 ? params[2] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
}
if (!stricmp(param, "ON"))
if (param == "ON")
{
nc->flags |= NI_SECURE;
notice_lang(s_NickServ, u, NICK_SASET_SECURE_ON, nc->display);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags &= ~NI_SECURE;
notice_lang(s_NickServ, u, NICK_SASET_SECURE_OFF, nc->display);
@@ -276,22 +275,22 @@ private:
return MOD_CONT;
}
CommandReturn DoSetPrivate(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetPrivate(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
ci::string param = params.size() > 2 ? params[2] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
}
if (!stricmp(param, "ON"))
if (param == "ON")
{
nc->flags |= NI_PRIVATE;
notice_lang(s_NickServ, u, NICK_SASET_PRIVATE_ON, nc->display);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags &= ~NI_PRIVATE;
notice_lang(s_NickServ, u, NICK_SASET_PRIVATE_OFF, nc->display);
@@ -301,11 +300,11 @@ private:
return MOD_CONT;
}
CommandReturn DoSetMsg(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetMsg(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
ci::string param = params.size() > 2 ? params[2] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
@@ -317,12 +316,12 @@ private:
return MOD_CONT;
}
if (!stricmp(param, "ON"))
if (param == "ON")
{
nc->flags |= NI_MSG;
notice_lang(s_NickServ, u, NICK_SASET_MSG_ON, nc->display);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags &= ~NI_MSG;
notice_lang(s_NickServ, u, NICK_SASET_MSG_OFF, nc->display);
@@ -332,11 +331,11 @@ private:
return MOD_CONT;
}
CommandReturn DoSetHide(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetHide(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
ci::string param = params.size() > 2 ? params[2] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
@@ -344,25 +343,25 @@ private:
int flag, onmsg, offmsg;
if (!stricmp(param, "EMAIL"))
if (param == "EMAIL")
{
flag = NI_HIDE_EMAIL;
onmsg = NICK_SASET_HIDE_EMAIL_ON;
offmsg = NICK_SASET_HIDE_EMAIL_OFF;
}
else if (!stricmp(param, "USERMASK"))
else if (param == "USERMASK")
{
flag = NI_HIDE_MASK;
onmsg = NICK_SASET_HIDE_MASK_ON;
offmsg = NICK_SASET_HIDE_MASK_OFF;
}
else if (!stricmp(param, "STATUS"))
else if (param == "STATUS")
{
flag = NI_HIDE_STATUS;
onmsg = NICK_SASET_HIDE_STATUS_ON;
offmsg = NICK_SASET_HIDE_STATUS_OFF;
}
else if (!stricmp(param, "QUIT"))
else if (param == "QUIT")
{
flag = NI_HIDE_QUIT;
onmsg = NICK_SASET_HIDE_QUIT_ON;
@@ -374,15 +373,15 @@ private:
return MOD_CONT;
}
param = params.size() > 3 ? params[3].c_str() : NULL;
if (!param)
param = params.size() > 3 ? params[3] : "";
if (param.empty())
syntax_error(s_NickServ, u, "SASET HIDE", NICK_SASET_HIDE_SYNTAX);
else if (!stricmp(param, "ON"))
else if (param == "ON")
{
nc->flags |= flag;
notice_lang(s_NickServ, u, onmsg, nc->display, s_NickServ);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags &= ~flag;
notice_lang(s_NickServ, u, offmsg, nc->display, s_NickServ);
@@ -392,22 +391,22 @@ private:
return MOD_CONT;
}
CommandReturn DoSetNoExpire(User *u, std::vector<std::string> &params, NickAlias *na)
CommandReturn DoSetNoExpire(User *u, std::vector<ci::string> &params, NickAlias *na)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
ci::string param = params.size() > 2 ? params[2] : "";
if (!param)
if (param.empty())
{
syntax_error(s_NickServ, u, "SASET NOEXPIRE", NICK_SASET_NOEXPIRE_SYNTAX);
return MOD_CONT;
}
if (!stricmp(param, "ON"))
if (param == "ON")
{
na->status |= NS_NO_EXPIRE;
notice_lang(s_NickServ, u, NICK_SASET_NOEXPIRE_ON, na->nick);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
na->status &= ~NS_NO_EXPIRE;
notice_lang(s_NickServ, u, NICK_SASET_NOEXPIRE_OFF, na->nick);
@@ -417,22 +416,22 @@ private:
return MOD_CONT;
}
CommandReturn DoSetAutoOP(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetAutoOP(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
ci::string param = params.size() > 2 ? params[2] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
}
if (!stricmp(param, "ON"))
if (param == "ON")
{
nc->flags &= ~NI_AUTOOP;
notice_lang(s_NickServ, u, NICK_SASET_AUTOOP_ON, nc->display);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags |= NI_AUTOOP;
notice_lang(s_NickServ, u, NICK_SASET_AUTOOP_OFF, nc->display);
@@ -443,7 +442,7 @@ private:
return MOD_CONT;
}
CommandReturn DoSetLanguage(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetLanguage(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 2 ? params[2].c_str() : NULL;
@@ -476,10 +475,10 @@ public:
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
const char *cmd = params[1].c_str();
ci::string cmd = params[1];
NickAlias *na;
@@ -498,36 +497,36 @@ public:
notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick);
else if (na->nc->flags & NI_SUSPENDED)
notice_lang(s_NickServ, u, NICK_X_SUSPENDED, na->nick);
else if (!stricmp(cmd, "DISPLAY"))
else if (cmd == "DISPLAY")
return this->DoSetDisplay(u, params, na->nc);
else if (!stricmp(cmd, "PASSWORD"))
else if (cmd == "PASSWORD")
return this->DoSetPassword(u, params, na->nc);
else if (!stricmp(cmd, "URL"))
else if (cmd == "URL")
return this->DoSetUrl(u, params, na->nc);
else if (!stricmp(cmd, "EMAIL"))
else if (cmd == "EMAIL")
return this->DoSetEmail(u, params, na->nc);
else if (!stricmp(cmd, "ICQ"))
else if (cmd == "ICQ")
return this->DoSetICQ(u, params, na->nc);
else if (!stricmp(cmd, "GREET"))
else if (cmd == "GREET")
return this->DoSetGreet(u, params, na->nc);
else if (!stricmp(cmd, "KILL"))
else if (cmd == "KILL")
return this->DoSetKill(u, params, na->nc);
else if (!stricmp(cmd, "SECURE"))
else if (cmd == "SECURE")
return this->DoSetSecure(u, params, na->nc);
else if (!stricmp(cmd, "PRIVATE"))
else if (cmd == "PRIVATE")
return this->DoSetPrivate(u, params, na->nc);
else if (!stricmp(cmd, "MSG"))
else if (cmd == "MSG")
return this->DoSetMsg(u, params, na->nc);
else if (!stricmp(cmd, "HIDE"))
else if (cmd == "HIDE")
return this->DoSetHide(u, params, na->nc);
else if (!stricmp(cmd, "NOEXPIRE"))
else if (cmd == "NOEXPIRE")
return this->DoSetNoExpire(u, params, na);
else if (!stricmp(cmd, "AUTOOP"))
else if (cmd == "AUTOOP")
return this->DoSetAutoOP(u, params, na->nc);
else if (!stricmp(cmd, "LANGUAGE"))
else if (cmd == "LANGUAGE")
return this->DoSetLanguage(u, params, na->nc);
else
notice_lang(s_NickServ, u, NICK_SASET_UNKNOWN_OPTION, cmd);
notice_lang(s_NickServ, u, NICK_SASET_UNKNOWN_OPTION, cmd.c_str());
return MOD_CONT;
}
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandNSSendPass : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
NickAlias *na;
+70 -70
View File
@@ -18,11 +18,11 @@
class CommandNSSet : public Command
{
private:
CommandReturn DoSetDisplay(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetDisplay(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
@@ -35,7 +35,7 @@ class CommandNSSet : public Command
for (i = 0; i < nc->aliases.count; ++i)
{
na = static_cast<NickAlias *>(nc->aliases.list[i]);
if (!stricmp(na->nick, param))
if (na->nick == param)
{
param = na->nick; /* Because case may differ */
break;
@@ -48,25 +48,25 @@ class CommandNSSet : public Command
return MOD_CONT;
}
change_core_display(nc, param);
change_core_display(nc, param.c_str());
notice_lang(s_NickServ, u, NICK_SET_DISPLAY_CHANGED, nc->display);
return MOD_CONT;
}
CommandReturn DoSetPassword(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetPassword(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
}
int len = strlen(param);
int len = param.size();
char tmp_pass[PASSMAX];
if (!stricmp(nc->display, param) || (StrictPasswords && len < 5))
if (nc->display == param || (StrictPasswords && len < 5))
{
notice_lang(s_NickServ, u, MORE_OBSCURE_PASSWORD);
return MOD_CONT;
@@ -77,7 +77,7 @@ class CommandNSSet : public Command
return MOD_CONT;
}
if (enc_encrypt(param, len, nc->pass, PASSMAX - 1) < 0)
if (enc_encrypt(param.c_str(), len, nc->pass, PASSMAX - 1) < 0)
{
params[1].clear();
alog("%s: Failed to encrypt password for %s (set)", s_NickServ, nc->display);
@@ -96,7 +96,7 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetLanguage(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetLanguage(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
@@ -124,7 +124,7 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetUrl(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetUrl(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
@@ -144,7 +144,7 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetEmail(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetEmail(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
@@ -177,7 +177,7 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetICQ(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetICQ(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
@@ -200,7 +200,7 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetGreet(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetGreet(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
@@ -225,29 +225,29 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetKill(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetKill(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : NULL;
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
}
if (!stricmp(param, "ON"))
if (param == "ON")
{
nc->flags |= NI_KILLPROTECT;
nc->flags &= ~(NI_KILL_QUICK | NI_KILL_IMMED);
notice_lang(s_NickServ, u, NICK_SET_KILL_ON);
}
else if (!stricmp(param, "QUICK"))
else if (param == "QUICK")
{
nc->flags |= NI_KILLPROTECT | NI_KILL_QUICK;
nc->flags &= ~NI_KILL_IMMED;
notice_lang(s_NickServ, u, NICK_SET_KILL_QUICK);
}
else if (!stricmp(param, "IMMED"))
else if (param == "IMMED")
{
if (NSAllowKillImmed)
{
@@ -258,7 +258,7 @@ class CommandNSSet : public Command
else
notice_lang(s_NickServ, u, NICK_SET_KILL_IMMED_DISABLED);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags &= ~(NI_KILLPROTECT | NI_KILL_QUICK | NI_KILL_IMMED);
notice_lang(s_NickServ, u, NICK_SET_KILL_OFF);
@@ -268,22 +268,22 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetSecure(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetSecure(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
}
if (!stricmp(param, "ON"))
if (param == "ON")
{
nc->flags |= NI_SECURE;
notice_lang(s_NickServ, u, NICK_SET_SECURE_ON);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags &= ~NI_SECURE;
notice_lang(s_NickServ, u, NICK_SET_SECURE_OFF);
@@ -293,22 +293,22 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetPrivate(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetPrivate(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
}
if (!stricmp(param, "ON"))
if (param == "ON")
{
nc->flags |= NI_PRIVATE;
notice_lang(s_NickServ, u, NICK_SET_PRIVATE_ON);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags &= ~NI_PRIVATE;
notice_lang(s_NickServ, u, NICK_SET_PRIVATE_OFF);
@@ -318,11 +318,11 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetMsg(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetMsg(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
@@ -334,12 +334,12 @@ class CommandNSSet : public Command
return MOD_CONT;
}
if (!stricmp(param, "ON"))
if (param == "ON")
{
nc->flags |= NI_MSG;
notice_lang(s_NickServ, u, NICK_SET_MSG_ON);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags &= ~NI_MSG;
notice_lang(s_NickServ, u, NICK_SET_MSG_OFF);
@@ -349,11 +349,11 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetHide(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetHide(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
@@ -361,25 +361,25 @@ class CommandNSSet : public Command
int flag, onmsg, offmsg;
if (!stricmp(param, "EMAIL"))
if (param == "EMAIL")
{
flag = NI_HIDE_EMAIL;
onmsg = NICK_SET_HIDE_EMAIL_ON;
offmsg = NICK_SET_HIDE_EMAIL_OFF;
}
else if (!stricmp(param, "USERMASK"))
else if (param == "USERMASK")
{
flag = NI_HIDE_MASK;
onmsg = NICK_SET_HIDE_MASK_ON;
offmsg = NICK_SET_HIDE_MASK_OFF;
}
else if (!stricmp(param, "STATUS"))
else if (param == "STATUS")
{
flag = NI_HIDE_STATUS;
onmsg = NICK_SET_HIDE_STATUS_ON;
offmsg = NICK_SET_HIDE_STATUS_OFF;
}
else if (!stricmp(param, "QUIT"))
else if (param == "QUIT")
{
flag = NI_HIDE_QUIT;
onmsg = NICK_SET_HIDE_QUIT_ON;
@@ -391,15 +391,15 @@ class CommandNSSet : public Command
return MOD_CONT;
}
param = params.size() > 2 ? params[2].c_str() : NULL;
if (!param)
param = params.size() > 2 ? params[2] : "";
if (param.empty())
syntax_error(s_NickServ, u, "SET HIDE", NICK_SET_HIDE_SYNTAX);
else if (!stricmp(param, "ON"))
else if (param == "ON")
{
nc->flags |= flag;
notice_lang(s_NickServ, u, onmsg, s_NickServ);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags &= ~flag;
notice_lang(s_NickServ, u, offmsg, s_NickServ);
@@ -409,11 +409,11 @@ class CommandNSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetAutoOP(User *u, std::vector<std::string> &params, NickCore *nc)
CommandReturn DoSetAutoOP(User *u, std::vector<ci::string> &params, NickCore *nc)
{
const char *param = params.size() > 1 ? params[1].c_str() : NULL;
ci::string param = params.size() > 1 ? params[1] : "";
if (!param)
if (param.empty())
{
this->OnSyntaxError(u);
return MOD_CONT;
@@ -424,12 +424,12 @@ class CommandNSSet : public Command
* This is so when people upgrade, and dont have the flag
* the default is on
**/
if (!stricmp(param, "ON"))
if (param == "ON")
{
nc->flags &= ~NI_AUTOOP;
notice_lang(s_NickServ, u, NICK_SET_AUTOOP_ON);
}
else if (!stricmp(param, "OFF"))
else if (param == "OFF")
{
nc->flags |= NI_AUTOOP;
notice_lang(s_NickServ, u, NICK_SET_AUTOOP_OFF);
@@ -444,9 +444,9 @@ class CommandNSSet : 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 (readonly)
{
@@ -460,34 +460,34 @@ class CommandNSSet : public Command
*/
if (u->nc->flags & NI_SUSPENDED)
notice_lang(s_NickServ, u, NICK_X_SUSPENDED, u->nc->display);
else if (!stricmp(cmd, "DISPLAY"))
else if (cmd == "DISPLAY")
return this->DoSetDisplay(u, params, u->nc);
else if (!stricmp(cmd, "PASSWORD"))
else if (cmd == "PASSWORD")
return this->DoSetPassword(u, params, u->nc);
else if (!stricmp(cmd, "LANGUAGE"))
else if (cmd == "LANGUAGE")
return this->DoSetLanguage(u, params, u->nc);
else if (!stricmp(cmd, "URL"))
else if (cmd == "URL")
return this->DoSetUrl(u, params, u->nc);
else if (!stricmp(cmd, "EMAIL"))
else if (cmd == "EMAIL")
return this->DoSetEmail(u, params, u->nc);
else if (!stricmp(cmd, "ICQ"))
else if (cmd == "ICQ")
return this->DoSetICQ(u, params, u->nc);
else if (!stricmp(cmd, "GREET"))
else if (cmd == "GREET")
return this->DoSetGreet(u, params, u->nc);
else if (!stricmp(cmd, "KILL"))
else if (cmd == "KILL")
return this->DoSetKill(u, params, u->nc);
else if (!stricmp(cmd, "SECURE"))
else if (cmd == "SECURE")
return this->DoSetSecure(u, params, u->nc);
else if (!stricmp(cmd, "PRIVATE"))
else if (cmd == "PRIVATE")
return this->DoSetPrivate(u, params, u->nc);
else if (!stricmp(cmd, "MSG"))
else if (cmd == "MSG")
return this->DoSetMsg(u, params, u->nc);
else if (!stricmp(cmd, "HIDE"))
else if (cmd == "HIDE")
return this->DoSetHide(u, params, u->nc);
else if (!stricmp(cmd, "AUTOOP"))
else if (cmd == "AUTOOP")
return this->DoSetAutoOP(u, params, u->nc);
else
notice_lang(s_NickServ, u, NICK_SET_UNKNOWN_OPTION, cmd);
notice_lang(s_NickServ, u, NICK_SET_UNKNOWN_OPTION, cmd.c_str());
return MOD_CONT;
}
+1 -1
View File
@@ -23,7 +23,7 @@ class CommandNSStatus : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
User *u2;
NickAlias *na = NULL;
+2 -2
View File
@@ -22,7 +22,7 @@ class CommandNSSuspend : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickAlias *na, *na2;
User *u2;
@@ -112,7 +112,7 @@ class CommandNSUnSuspend : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickAlias *na;
const char *nick = params[0].c_str();
+1 -3
View File
@@ -22,14 +22,12 @@ class CommandNSUpdate : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
NickAlias *na = findnick(u->nick);
if (!na)
{
return MOD_CONT;
}
do_setmodes(u);
check_memos(u);
+13 -13
View File
@@ -23,7 +23,7 @@ int akill_list(int number, Akill *ak, User *u, int *sent_header);
class CommandOSAKill : public Command
{
private:
CommandReturn DoAdd(User *u, std::vector<std::string> &params)
CommandReturn DoAdd(User *u, std::vector<ci::string> &params)
{
int deleted = 0;
unsigned last_param = 2;
@@ -141,7 +141,7 @@ class CommandOSAKill : 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 *mask;
int res = 0;
@@ -192,7 +192,7 @@ class CommandOSAKill : public Command
return MOD_CONT;
}
CommandReturn DoList(User *u, std::vector<std::string> &params)
CommandReturn DoList(User *u, std::vector<ci::string> &params)
{
const char *mask;
int res, sent_header = 0;
@@ -237,7 +237,7 @@ class CommandOSAKill : public Command
return MOD_CONT;
}
CommandReturn DoView(User *u, std::vector<std::string> &params)
CommandReturn DoView(User *u, std::vector<ci::string> &params)
{
const char *mask;
int res, sent_header = 0;
@@ -278,7 +278,7 @@ class CommandOSAKill : public Command
return MOD_CONT;
}
CommandReturn DoClear(User *u, std::vector<std::string> &params)
CommandReturn DoClear(User *u)
{
slist_clear(&akills, 1);
notice_lang(s_OperServ, u, OPER_AKILL_CLEAR);
@@ -290,20 +290,20 @@ class CommandOSAKill : 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 (!stricmp(cmd, "ADD"))
if (cmd == "ADD")
return this->DoAdd(u, params);
else if (!stricmp(cmd, "DEL"))
else if (cmd == "DEL")
return this->DoDel(u, params);
else if (!stricmp(cmd, "LIST"))
else if (cmd == "LIST")
return this->DoList(u, params);
else if (!stricmp(cmd, "VIEW"))
else if (cmd == "VIEW")
return this->DoView(u, params);
else if (!stricmp(cmd, "CLEAR"))
return this->DoClear(u, params);
else if (cmd == "CLEAR")
return this->DoClear(u);
else
this->OnSyntaxError(u);
return MOD_CONT;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandOSChanKill : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *expiry, *channel;
char reason[BUFSIZE], realreason[BUFSIZE];
+3 -3
View File
@@ -22,15 +22,15 @@ class CommandOSChanList : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *pattern = params.size() > 0 ? params[0].c_str() : NULL;
const char *opt = params.size() > 1 ? params[1].c_str() : NULL;
ci::string opt = params.size() > 1 ? params[1] : "";
int modes = 0;
User *u2;
if (opt && !stricmp(opt, "SECRET"))
if (!opt.empty() && opt == "SECRET")
modes |= (anope_get_secret_mode() | anope_get_private_mode());
if (pattern && (u2 = finduser(pattern)))
+4 -5
View File
@@ -22,9 +22,8 @@ class CommandOSClearModes : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *s;
const char *argv[2];
const char *chan = params[0].c_str();
Channel *c;
@@ -44,9 +43,9 @@ class CommandOSClearModes : public Command
}
else
{
s = params.size() > 1 ? params[1].c_str() : NULL;
if (s) {
if (!stricmp(s, "ALL"))
ci::string s = params.size() > 1 ? params[1] : "";
if (!s.empty()) {
if (s == "ALL")
all = 1;
else {
this->OnSyntaxError(u);
+1 -1
View File
@@ -24,7 +24,7 @@ class CommandOSDEFCON : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *lvl = params[0].c_str();
int newLevel = 0;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandOSGlobal : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *msg = params[0].c_str();
+2 -2
View File
@@ -22,9 +22,9 @@ class CommandOSHelp : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
mod_help_cmd(s_OperServ, u, OPERSERV, params.size() > 0 ? params[0].c_str() : NULL);
mod_help_cmd(s_OperServ, u, OPERSERV, params[0].c_str());
return MOD_CONT;
}
+12 -12
View File
@@ -18,7 +18,7 @@
class CommandOSIgnore : public Command
{
private:
CommandReturn DoAdd(User *u, std::vector<std::string> &params)
CommandReturn DoAdd(User *u, std::vector<ci::string> &params)
{
const char *time = params.size() > 1 ? params[1].c_str() : NULL;
const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
@@ -53,7 +53,7 @@ class CommandOSIgnore : public Command
return MOD_CONT;
}
CommandReturn DoList(User *u, std::vector<std::string> &params)
CommandReturn DoList(User *u)
{
IgnoreData *id;
@@ -70,7 +70,7 @@ class CommandOSIgnore : 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.size() > 1 ? params[1].c_str() : NULL;
if (!nick)
@@ -88,7 +88,7 @@ class CommandOSIgnore : public Command
return MOD_CONT;
}
CommandReturn DoClear(User *u, std::vector<std::string> &params)
CommandReturn DoClear(User *u)
{
clear_ignores();
notice_lang(s_OperServ, u, OPER_IGNORE_LIST_CLEARED);
@@ -100,18 +100,18 @@ class CommandOSIgnore : 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 (!stricmp(cmd, "ADD"))
if (cmd == "ADD")
return this->DoAdd(u, params);
else if (!stricmp(cmd, "LIST"))
return this->DoList(u, params);
else if (!stricmp(cmd, "DEL"))
else if (cmd == "LIST")
return this->DoList(u);
else if (cmd == "DEL")
return this->DoDel(u, params);
else if (!stricmp(cmd, "CLEAR"))
return this->DoClear(u, params);
else if (cmd == "CLEAR")
return this->DoClear(u);
else
this->OnSyntaxError(u);
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandOSJupe : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *jserver = params[0].c_str();
const char *reason = params.size() > 1 ? params[1].c_str() : NULL;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandOSKick : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *argv[3];
const char *chan = params[0].c_str(), *nick = params[1].c_str(), *s = params[2].c_str();
+2 -2
View File
@@ -22,7 +22,7 @@ class CommandOSMode : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
int ac;
const char **av;
@@ -37,7 +37,7 @@ class CommandOSMode : public Command
{
ircdproto->SendMode(findbot(s_OperServ), chan, "%s", modes);
ac = split_buf((char *)modes, &av, 1);
ac = split_buf(const_cast<char *>(modes), /* XXX */ &av, 1);
chan_set_modes(s_OperServ, c, ac, av, -1);
free(av);
+1 -1
View File
@@ -24,7 +24,7 @@ class CommandOSModInfo : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *file = params[0].c_str();
struct tm tm;
+9 -9
View File
@@ -22,7 +22,7 @@ class CommandOSModList : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
int idx;
int count = 0;
@@ -33,7 +33,7 @@ class CommandOSModList : public Command
int showSupported = 1;
int showQA = 1;
const char *param = params.size() ? params[0].c_str() : NULL;
ci::string param = params.size() ? params[0] : "";
ModuleHash *current = NULL;
char core[] = "Core";
@@ -43,9 +43,9 @@ class CommandOSModList : public Command
char supported[] = "Supported";
char qa[] = "QATested";
if (param)
if (!param.empty())
{
if (!stricmp(param, core))
if (param == core)
{
showCore = 1;
showThird = 0;
@@ -54,7 +54,7 @@ class CommandOSModList : public Command
showSupported = 0;
showQA = 0;
}
else if (!stricmp(param, third))
else if (param == third)
{
showCore = 0;
showThird = 1;
@@ -63,7 +63,7 @@ class CommandOSModList : public Command
showProto = 0;
showEnc = 0;
}
else if (!stricmp(param, proto))
else if (param == proto)
{
showCore = 0;
showThird = 0;
@@ -72,7 +72,7 @@ class CommandOSModList : public Command
showSupported = 0;
showQA = 0;
}
else if (!stricmp(param, supported))
else if (param == supported)
{
showCore = 0;
showThird = 0;
@@ -81,7 +81,7 @@ class CommandOSModList : public Command
showEnc = 0;
showQA = 0;
}
else if (!stricmp(param, qa))
else if (param == qa)
{
showCore = 0;
showThird = 0;
@@ -90,7 +90,7 @@ class CommandOSModList : public Command
showEnc = 0;
showQA = 1;
}
else if (!stricmp(param, enc))
else if (param == enc)
{
showCore = 0;
showThird = 0;
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandOSModLoad : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *name = params[0].c_str();
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandOSModUnLoad : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *name = params[0].c_str();
int status;
+13 -17
View File
@@ -98,7 +98,7 @@ static int *findmsgs(int16 type, const char **type_name)
class NewsBase : public Command
{
protected:
CommandReturn DoList(User *u, std::vector<std::string> &params, short type, int *msgs)
CommandReturn DoList(User *u, short type, int *msgs)
{
int i, count = 0;
char timebuf[64];
@@ -124,7 +124,7 @@ class NewsBase : public Command
return MOD_CONT;
}
CommandReturn DoAdd(User *u, std::vector<std::string> &params, short type, int *msgs)
CommandReturn DoAdd(User *u, std::vector<ci::string> &params, short type, int *msgs)
{
const char *text = params.size() > 1 ? params[1].c_str() : NULL;
int n;
@@ -148,7 +148,7 @@ class NewsBase : public Command
return MOD_CONT;
}
CommandReturn DoDel(User *u, std::vector<std::string> &params, short type, int *msgs)
CommandReturn DoDel(User *u, std::vector<ci::string> &params, short type, int *msgs)
{
const char *text = params.size() > 1 ? params[1].c_str() : NULL;
int i, num;
@@ -190,9 +190,9 @@ class NewsBase : public Command
return MOD_CONT;
}
CommandReturn DoNews(User *u, std::vector<std::string> &params, short type)
CommandReturn DoNews(User *u, std::vector<ci::string> &params, short type)
{
const char *cmd = params[0].c_str();
ci::string cmd = params[0];
const char *type_name;
int *msgs;
@@ -209,16 +209,12 @@ class NewsBase : public Command
return MOD_CONT;
}
if (!stricmp(cmd, "LIST"))
return this->DoList(u, params, type, msgs);
else if (!stricmp(cmd, "ADD"))
{
if (cmd == "LIST")
return this->DoList(u, type, msgs);
else if (cmd == "ADD")
return this->DoAdd(u, params, type, msgs);
}
else if (!stricmp(cmd, "DEL"))
{
else if (cmd == "DEL")
return this->DoDel(u, params, type, msgs);
}
else
this->OnSyntaxError(u);
@@ -233,7 +229,7 @@ class NewsBase : public Command
{
}
virtual CommandReturn Execute(User *u, std::vector<std::string> &params) = 0;
virtual CommandReturn Execute(User *u, std::vector<ci::string> &params) = 0;
virtual bool OnHelp(User *u, const ci::string &subcommand) = 0;
@@ -255,7 +251,7 @@ class CommandOSLogonNews : public NewsBase
delete [] this->help_param1;
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return this->DoNews(u, params, NEWS_LOGON);
}
@@ -298,7 +294,7 @@ class CommandOSOperNews : public NewsBase
delete [] this->help_param1;
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return this->DoNews(u, params, NEWS_OPER);
}
@@ -333,7 +329,7 @@ class CommandOSRandomNews : public NewsBase
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
return this->DoNews(u, params, NEWS_RANDOM);
}
+4 -4
View File
@@ -22,12 +22,12 @@ class CommandOSNOOP : 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];
const char *server = params[1].c_str();
if (!stricmp(cmd, "SET"))
if (cmd == "SET")
{
User *u2;
User *u3 = NULL;
@@ -49,7 +49,7 @@ class CommandOSNOOP : public Command
kill_user(s_OperServ, u2->nick, reason);
}
}
else if (!stricmp(cmd, "REVOKE"))
else if (cmd == "REVOKE")
{
ircdproto->SendSVSNOOP(server, 0);
notice_lang(s_OperServ, u, OPER_NOOP_REVOKE, server);
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandOSOLine : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *nick = params[0].c_str();
const char *flag = params[1].c_str();
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandOSQuit : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
quitmsg = new char[28 + strlen(u->nick)];
+1 -1
View File
@@ -22,7 +22,7 @@ class CommandOSReload : public Command
{
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
if (!read_config(1))
{

Some files were not shown because too many files have changed in this diff Show More