fixed some bugs
authorpk910 <philipp@zoelle1.de>
Sun, 1 Jul 2012 10:31:34 +0000 (12:31 +0200)
committerpk910 <philipp@zoelle1.de>
Sun, 1 Jul 2012 10:31:34 +0000 (12:31 +0200)
src/modules/DummyServ.mod/bot_DummyServ.c
src/modules/NeonBackup.mod/bot_NeonBackup.c
src/modules/NeonFun.mod/bot_NeonFun.c
src/modules/NeonHelp.mod/bot_NeonHelp.c
src/modules/NeonServ.mod/bot_NeonServ.c
src/modules/NeonSpam.mod/bot_NeonSpam.c

index 1b078ec00d073569cb224cd1158fa6e68454415f..40359bacc308cca17f5effd2148f061f352ababe 100644 (file)
@@ -42,6 +42,8 @@
 #define BOTALIAS "DummyServ"
 
 static void dummyserv_bot_ready(struct ClientSocket *client) {
+    if(client->botid != BOTID)
+        return;
     MYSQL_RES *res;
     MYSQL_ROW row;
     
index 916e3b27fcbd07b416ffd95f1e81a47b1a939788..9738afbdcb80cd5747dc24fdcd15c003cb4f3e9a 100644 (file)
@@ -40,6 +40,8 @@ static const struct default_language_entry msgtab[] = {
 };
 
 static void neonbackup_bot_ready(struct ClientSocket *client) {
+    if(client->botid != BOTID)
+        return;
     MYSQL_RES *res;
     MYSQL_ROW row;
     
index 49364a2134d6fad22c446f3ac2c9ad4c9f33d233..75afbbad825c500f6153a7af86287c0e899b8494 100644 (file)
@@ -44,6 +44,8 @@
 #define BOTALIAS "NeonFun"
 
 static void neonfun_bot_ready(struct ClientSocket *client) {
+    if(client->botid != BOTID)
+        return;
     MYSQL_RES *res;
     MYSQL_ROW row;
     
index 68cf6626013bb3bb7bd07e54e86afdda32a675aa..07b6a975ecbc684117534b401fa9040d085e1cf4 100644 (file)
@@ -70,6 +70,8 @@ static const struct default_language_entry msgtab[] = {
 };
 
 static void neonhelp_bot_ready(struct ClientSocket *client) {
+    if(client->botid != BOTID)
+        return;
     MYSQL_RES *res;
     MYSQL_ROW row;
     
index 16d6dbdfe5d943568b1deeb64c53a97f13967364..4d377e4e2e5033e8604c4712e92cab495ab882b6 100644 (file)
@@ -418,6 +418,8 @@ struct ClientSocket *getBotForChannel(struct ChanNode *chan) {
 }
 
 static void neonserv_bot_ready(struct ClientSocket *client) {
+    if(client->botid != BOTID)
+        return;
     MYSQL_RES *res;
     MYSQL_ROW row;
     
index de645c2470edf4ea752fc579b6c1762c107660de..16e0016a3dc57bdea26a5a1267f6a6d62b1018d4 100644 (file)
@@ -103,32 +103,9 @@ static struct NeonSpamJoinNode *getNeonSpamJoinNode(struct ChanUser *chanuser);
 #include "event_neonspam_join.c"
 #include "event_neonspam_chanmsg.c"
 
-static void neonspam_event_kick(struct UserNode *user, struct ChanUser *target, char *reason) {
-    struct ChanNode *chan = target->chan;
-    if(isBot(target->user)) {
-        struct ClientSocket *client = getChannelBot(chan, 0);
-        struct ClientSocket *bot = client;
-        for(client = getBots(SOCKET_FLAG_READY, NULL); client; client = getBots(SOCKET_FLAG_READY, client)) {
-            if(client->user == target->user) {
-                break;
-            }
-        }
-        if(!client) return;
-        if(bot && bot != client && (isModeSet(chan->modes, 'i') || isModeSet(chan->modes, 'a') || isModeSet(chan->modes, 'l'))) {
-            struct ChanUser *chanuser = getChanUser(bot->user, chan);
-            if(chanuser && chanuser->flags & CHANUSERFLAG_OPPED)
-                putsock(bot, "INVITE %s %s", target->user->nick, chan->name);
-        }
-        char *key = "";
-        if(isModeSet(chan->modes, 'k')) {
-            key = getModeValue(chan->modes, 'k');
-        }
-        putsock(client, "JOIN %s %s", chan->name, key);
-        return;
-    }
-}
-
 static void neonspam_bot_ready(struct ClientSocket *client) {
+    if(client->botid != BOTID)
+        return;
     MYSQL_RES *res;
     MYSQL_ROW row;
     
@@ -416,7 +393,6 @@ void init_NeonSpam(int type) {
     bind_join(neonspam_event_join, module_id);
     bind_chanmsg(neonspam_event_chanmsg, module_id);
     bind_privctcp(general_event_privctcp, module_id);
-    bind_kick(neonspam_event_kick, module_id);
     bind_freechan(neonspam_event_freechan, module_id);
     bind_invite(neonspam_event_invite, module_id);