diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-07-25 00:37:43 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-07-25 00:37:43 +0000 |
commit | b2a57b09742da6c2f2011ad41eb470139d88e14f (patch) | |
tree | 054e41a724108706c5ea5f659d2065fe5fae2504 /src/core/bs_set.c | |
parent | 443654f15bf036bb18f9847332e2bd03ec823b3d (diff) |
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
Diffstat (limited to 'src/core/bs_set.c')
-rw-r--r-- | src/core/bs_set.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/core/bs_set.c b/src/core/bs_set.c index c68a11688..c7c67714b 100644 --- a/src/core/bs_set.c +++ b/src/core/bs_set.c @@ -23,11 +23,11 @@ class CommandBSSet : public Command this->SetFlag(CFLAG_STRIP_CHANNEL); } - CommandReturn Execute(User *u, std::vector<std::string> ¶ms) + CommandReturn Execute(User *u, std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); - const char *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; |