summaryrefslogtreecommitdiff
path: root/src/commands.c
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2010-01-04 06:40:24 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2010-01-04 06:40:24 +0000
commitb462814760cb7c0830072275acc97291a9fb905b (patch)
tree56cfe6caee408eb852f728cd8aaa2d18e4365228 /src/commands.c
parent2708eea5d13c249143b83fbaa8b552992f0ac8b6 (diff)
Changed 'char *' fields in BotInfo to 'std::string', cleanup of bots.cpp, changed many other functions to use 'const std::string &' arguments as a chain reaction.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2733 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/commands.c')
-rw-r--r--src/commands.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/commands.c b/src/commands.c
index 553bc2442..f8a1bba62 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -48,7 +48,7 @@ Command *lookup_cmd(Command * list, char *cmd)
* @param cmd Command
* @return void
*/
-void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *cmd)
+void mod_run_cmd(const std::string &service, User * u, CommandHash * cmdTable[], const char *cmd)
{
Command *c = findCommand(cmdTable, cmd);
int retVal = MOD_CONT;
@@ -58,10 +58,10 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
FOREACH_RESULT(I_OnPreCommandRun, OnPreCommandRun(service, u, cmd, c));
if (MOD_RESULT == EVENT_STOP)
return;
-
+
if (!c)
{
- notice_lang(service, u, UNKNOWN_COMMAND_HELP, cmd, service);
+ notice_lang(service, u, UNKNOWN_COMMAND_HELP, cmd, service.c_str());
return;
}
@@ -71,7 +71,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
if (!nick_identified(u))
{
notice_lang(service, u, NICK_IDENTIFY_REQUIRED, Config.s_NickServ);
- alog("Access denied for unregistered user %s with service %s and command %s", u->nick.c_str(), service, cmd);
+ alog("Access denied for unregistered user %s with service %s and command %s", u->nick.c_str(), service.c_str(), cmd);
return;
}
}
@@ -122,14 +122,14 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
{
notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name.c_str());
alog("Access denied for user %s with service %s and command %s because of FORBIDDEN channel %s",
- u->nick.c_str(), service, cmd, ci->name.c_str());
+ u->nick.c_str(), service.c_str(), cmd, ci->name.c_str());
return;
}
else if ((ci->HasFlag(CI_SUSPENDED)) && (!c->HasFlag(CFLAG_ALLOW_SUSPENDED)))
{
notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name.c_str());
alog("Access denied for user %s with service %s and command %s because of SUSPENDED channel %s",
- u->nick.c_str(), service, cmd, ci->name.c_str());
+ u->nick.c_str(), service.c_str(), cmd, ci->name.c_str());
return;
}
}
@@ -153,7 +153,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
if (!u->nc->HasCommand(c->permission))
{
notice_lang(service, u, ACCESS_DENIED);
- alog("Access denied for user %s with service %s and command %s", u->nick.c_str(), service, cmd);
+ alog("Access denied for user %s with service %s and command %s", u->nick.c_str(), service.c_str(), cmd);
return;
}