1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 04:03:12 +02:00

Various fixes.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1988 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
rburchell
2009-02-10 21:16:20 +00:00
parent b1ee732713
commit 79f09ed157
5 changed files with 17 additions and 14 deletions
+6 -2
View File
@@ -29,7 +29,6 @@ class CommandOSChanKill : public Command
const char *expiry, *channel;
char reason[BUFSIZE];
time_t expires;
char breason[BUFSIZE];
char mask[USERMAX + HOSTMAX + 2];
struct c_userlist *cu, *next;
int last_param = 1;
@@ -61,7 +60,7 @@ class CommandOSChanKill : public Command
this->OnSyntaxError(u);
return MOD_CONT;
}
snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 1 ? " " : "", last_param == 1 ? param[2].c_str() : "");
snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 1 ? " " : "", last_param == 1 ? params[2].c_str() : "");
if (*reason)
{
@@ -88,6 +87,11 @@ class CommandOSChanKill : public Command
}
return MOD_CONT;
}
void OnSyntaxError(User *u)
{
syntax_error(s_OperServ, u, "CHANKILL", OPER_CHANKILL_SYNTAX);
}
};
class OSChanKill : public Module
+3 -3
View File
@@ -26,8 +26,8 @@ class CommandOSChanList : public Command
CommandReturn Execute(User *u, std::vector<std::string> &params)
{
char *pattern = params.size() > 0 ? params[0].c_str() : NULL;
char *opt = params.size() > 1 ? params[1].c_str() : NULL;
const char *pattern = params.size() > 0 ? params[0].c_str() : NULL;
const char *opt = params.size() > 1 ? params[1].c_str() : NULL;
int modes = 0;
User *u2;
@@ -77,7 +77,7 @@ class CommandOSChanList : public Command
if (!is_services_oper(u))
return false;
notice_lang(s_OperServ, u, OPER_HELP_CHAN_LIST);
notice_lang(s_OperServ, u, OPER_HELP_CHANLIST);
return true;
}
};
+2 -2
View File
@@ -28,9 +28,9 @@ class CommandOSDEFCON : public Command
CommandReturn Execute(User *u, std::vector<std::string> &params)
{
char *lvl = params[0].c_str();
const char *lvl = params[0].c_str();
int newLevel = 0;
char *langglobal = getstring(NULL, DEFCON_GLOBAL);
const char *langglobal = getstring(NULL, DEFCON_GLOBAL);
if (!DefConLevel) /* If we dont have a .conf setting! */
{
+4 -5
View File
@@ -22,8 +22,8 @@ class CommandOSIgnore : public Command
private:
CommandReturn DoAdd(User *u, std::vector<std::string> &params)
{
char *time = params.size() > 1 ? params[1].c_str() : NULL;
char *nick = params.size() > 2 ? params[2].c_str() : NULL;
const char *time = params.size() > 1 ? params[1].c_str() : NULL;
const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
int t;
if (!time || !nick)
@@ -74,7 +74,7 @@ class CommandOSIgnore : public Command
CommandReturn DoDel(User *u, std::vector<std::string> &params)
{
char *nick = params.size() > 1 ? params[1].c_str() : NULL;
const char *nick = params.size() > 1 ? params[1].c_str() : NULL;
if (!nick)
this->OnSyntaxError(u);
else
@@ -105,7 +105,6 @@ class CommandOSIgnore : public Command
CommandReturn Execute(User *u, std::vector<std::string> &params)
{
const char *cmd = params[0].c_str();
int t;
if (!stricmp(cmd, "ADD"))
return this->DoAdd(u, params);
@@ -114,7 +113,7 @@ class CommandOSIgnore : public Command
else if (!stricmp(cmd, "DEL"))
return this->DoDel(u, params);
else if (!stricmp(cmd, "CLEAR"))
return this->DoCelar(u, params);
return this->DoClear(u, params);
else
this->OnSyntaxError(u);
+2 -2
View File
@@ -28,7 +28,7 @@ class CommandOSMode : public Command
{
int ac;
const char **av;
char *chan = params[0].c_str(), *modes = params[1].c_str();
const char *chan = params[0].c_str(), *modes = params[1].c_str();
Channel *c;
if (!(c = findchan(chan)))
@@ -41,7 +41,7 @@ class CommandOSMode : public Command
{
ircdproto->SendMode(findbot(s_OperServ), chan, "%s", modes);
ac = split_buf(modes, &av, 1);
ac = split_buf((char *)modes, &av, 1);
chan_set_modes(s_OperServ, c, ac, av, -1);
free(av);