fixed last commit
authorpk910 <philipp@zoelle1.de>
Wed, 14 Sep 2011 21:36:58 +0000 (23:36 +0200)
committerpk910 <philipp@zoelle1.de>
Wed, 14 Sep 2011 22:06:46 +0000 (00:06 +0200)
BanNode.c
IRCParser.c
cmd_neonserv_resync.c

index 9bdab6c4f5fe48d2ee7df92b74655244688764e7..c1601f15d827bf9147fdbdff52fd0cac89479b33 100644 (file)
--- 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));
index 4ed222335036a1d20a87d6b8db5ea5e4cc283359..9332efa6170df2701c8151f2460e169b173c35cc 100644 (file)
@@ -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() {
index a05c0eecb6d6234feff0f8c4cb8e898e4636b558..5ce398305d0ab694fbf81c49bc6d012604a4a618 100644 (file)
@@ -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);