fixed some bugs
[NeonServV5.git] / src / modules / NeonSpam.mod / bot_NeonSpam.c
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);