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

Few fixes.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1987 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
rburchell
2009-02-10 21:16:00 +00:00
parent ef9f97fa05
commit b1ee732713
4 changed files with 15 additions and 9 deletions
+3 -3
View File
@@ -772,7 +772,7 @@ E int nick_is_services_root(NickCore * nc);
E int nick_is_services_admin(NickCore *nc);
E int nick_is_services_oper(NickCore *nc);
E int add_akill(User *u, char *mask, const char *by, const time_t expires, const char *reason);
E int add_akill(User *u, const char *mask, const char *by, const time_t expires, const char *reason);
E int check_akill(const char *nick, const char *username, const char *host, const char *vhost, const char *ip);
E void expire_akills();
E void oper_global(char *nick, const char *fmt, ...);
@@ -888,8 +888,8 @@ E int exception_add(User * u, const char *mask, const int limit,
E int slist_add(SList *slist, void *item);
E void slist_clear(SList *slist, int free);
E int slist_delete(SList *slist, int index);
E int slist_delete_range(SList *slist, char *range, slist_delcheckcb_t cb, ...);
E int slist_enum(SList *slist, char *range, slist_enumcb_t cb, ...);
E int slist_delete_range(SList *slist, const char *range, slist_delcheckcb_t cb, ...);
E int slist_enum(SList *slist, const char *range, slist_enumcb_t cb, ...);
E int slist_full(SList *slist);
E int slist_indexof(SList *slist, void *item);
E void slist_init(SList *slist);
+7
View File
@@ -24,6 +24,7 @@ class CommandOSAdmin : public Command
private:
CommandReturn DoAdd(User *u, std::vector<std::string> &params)
{
NickAlias *na;
const char *nick = params.size() > 1 ? params[1].c_str() : NULL;
int res = 0;
@@ -87,6 +88,7 @@ class CommandOSAdmin : public Command
CommandReturn DoDel(User *u, std::vector<std::string> &params)
{
const char *nick = params.size() > 1 ? params[1].c_str() : NULL;
NickAlias *na;
int res = 0;
if (!nick)
@@ -232,6 +234,11 @@ class CommandOSAdmin : public Command
this->OnSyntaxError(u);
return MOD_CONT;
}
void OnSyntaxError(User *u)
{
syntax_error(s_OperServ, u, "ADMIN", OPER_ADMIN_SYNTAX);
}
};
class OSAdmin : public Module
+4 -5
View File
@@ -61,7 +61,7 @@ class CommandOSAKill : public Command
this->OnSyntaxError(u);
return MOD_CONT;
}
snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 ? " " : "", last_param == 2 ? param[3].c_str() : "");
snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 ? " " : "", last_param == 2 ? params[3].c_str() : "");
if (mask && *reason) {
/* We first do some sanity check on the proposed mask. */
if (strchr(mask, '!'))
@@ -106,7 +106,7 @@ class CommandOSAKill : public Command
else
{
int wall_expiry = expires - time(NULL);
char *s = NULL;
const char *s = NULL;
if (wall_expiry >= 86400)
{
@@ -144,7 +144,7 @@ class CommandOSAKill : public Command
const char *mask;
int res = 0;
mask = params.size() > 1 ? params[1].c_str();
mask = params.size() > 1 ? params[1].c_str() : NULL;
if (!mask)
{
@@ -174,7 +174,7 @@ class CommandOSAKill : public Command
}
else
{
if ((res = slist_indexof(&akills, mask)) == -1)
if ((res = slist_indexof(&akills, (void *)mask)) == -1)
{
notice_lang(s_OperServ, u, OPER_AKILL_NOT_FOUND, mask);
return MOD_CONT;
@@ -291,7 +291,6 @@ class CommandOSAKill : public Command
CommandReturn Execute(User *u, std::vector<std::string> &params)
{
const char *cmd = params[0].c_str();
char breason[BUFSIZE];
if (!stricmp(cmd, "ADD"))
return this->DoAdd(u, params);
+1 -1
View File
@@ -490,7 +490,7 @@ void oper_global(char *nick, const char *fmt, ...)
* The success result is the number of AKILLs that were deleted to successfully add one.
*/
int add_akill(User * u, char *mask, const char *by, const time_t expires,
int add_akill(User * u, const char *mask, const char *by, const time_t expires,
const char *reason)
{
int deleted = 0, i;