From 6efdb39a2710eb71f84674a065973a20d4d9bb8d Mon Sep 17 00:00:00 2001 From: pk910 Date: Wed, 14 Sep 2011 23:36:58 +0200 Subject: [PATCH] fixed last commit --- BanNode.c | 1 + IRCParser.c | 2 ++ cmd_neonserv_resync.c | 8 +++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/BanNode.c b/BanNode.c index 9bdab6c..c1601f1 100644 --- a/BanNode.c +++ b/BanNode.c @@ -1,6 +1,7 @@ #include "BanNode.h" #include "ChanNode.h" +#include "tools.h" struct BanNode* addChannelBan(struct ChanNode *chan, char *mask) { struct BanNode *ban = malloc(sizeof(*ban)); diff --git a/IRCParser.c b/IRCParser.c index 4ed2223..9332efa 100644 --- a/IRCParser.c +++ b/IRCParser.c @@ -8,6 +8,7 @@ #include "WHOHandler.h" #include "lang.h" #include "DBHelper.h" +#include "BanNode.h" struct irc_cmd *irc_commands = NULL; @@ -352,6 +353,7 @@ static IRC_CMD(raw_367) { removeChannelBan(ban); } addChannelBan(chan, argv[2]); + return 1; } void init_parser() { diff --git a/cmd_neonserv_resync.c b/cmd_neonserv_resync.c index a05c0ee..5ce3983 100644 --- a/cmd_neonserv_resync.c +++ b/cmd_neonserv_resync.c @@ -16,7 +16,7 @@ struct neonserv_cmd_resync_cache { }; static CMD_BIND(neonserv_cmd_resync) { - int min_access = 1, max_access = 500; + int min_access = 0, max_access = 500; char *usermask = NULL; if(argc > 0) usermask = argv[0]; @@ -48,16 +48,18 @@ static USERLIST_CALLBACK(neonserv_cmd_resync_userlist_lookup) { static void neonserv_cmd_resync_async1(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, char *usermask, int min_access, int max_access) { MYSQL_RES *res; - MYSQL_ROW row, defaults; + MYSQL_ROW row, defaults = NULL; int i; int resync_op = 1; int resync_voice = 1; if(usermask && usermask[0] == '@') { resync_voice = 0; usermask++; + if(!*usermask) usermask = NULL; } else if(usermask && usermask[0] == '+') { resync_op = 0; usermask++; + if(!*usermask) usermask = NULL; } struct ChanUser *chanuser; int db_enfops, db_enfvoice; @@ -96,7 +98,7 @@ static void neonserv_cmd_resync_async1(struct ClientSocket *client, struct Clien } } } - if((usermask && match(usermask, row[1])) || caccess < min_access || caccess > max_access) continue; + if((usermask && *usermask && match(usermask, row[1])) || caccess < min_access || caccess > max_access) continue; if(caccess >= db_enfops) { if(!(chanuser->flags & CHANUSERFLAG_OPPED) && resync_op) modeBufferOp(modeBuf, chanuser->user->nick); -- 2.20.1