From 9f27add1dff4dfa36fb65d43805da1939fbe4a4b Mon Sep 17 00:00:00 2001 From: pk910 Date: Sun, 1 Jul 2012 12:31:34 +0200 Subject: [PATCH] fixed some bugs --- src/modules/DummyServ.mod/bot_DummyServ.c | 2 ++ src/modules/NeonBackup.mod/bot_NeonBackup.c | 2 ++ src/modules/NeonFun.mod/bot_NeonFun.c | 2 ++ src/modules/NeonHelp.mod/bot_NeonHelp.c | 2 ++ src/modules/NeonServ.mod/bot_NeonServ.c | 2 ++ src/modules/NeonSpam.mod/bot_NeonSpam.c | 28 ++------------------- 6 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/modules/DummyServ.mod/bot_DummyServ.c b/src/modules/DummyServ.mod/bot_DummyServ.c index 1b078ec..40359ba 100644 --- a/src/modules/DummyServ.mod/bot_DummyServ.c +++ b/src/modules/DummyServ.mod/bot_DummyServ.c @@ -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; diff --git a/src/modules/NeonBackup.mod/bot_NeonBackup.c b/src/modules/NeonBackup.mod/bot_NeonBackup.c index 916e3b2..9738afb 100644 --- a/src/modules/NeonBackup.mod/bot_NeonBackup.c +++ b/src/modules/NeonBackup.mod/bot_NeonBackup.c @@ -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; diff --git a/src/modules/NeonFun.mod/bot_NeonFun.c b/src/modules/NeonFun.mod/bot_NeonFun.c index 49364a2..75afbba 100644 --- a/src/modules/NeonFun.mod/bot_NeonFun.c +++ b/src/modules/NeonFun.mod/bot_NeonFun.c @@ -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; diff --git a/src/modules/NeonHelp.mod/bot_NeonHelp.c b/src/modules/NeonHelp.mod/bot_NeonHelp.c index 68cf662..07b6a97 100644 --- a/src/modules/NeonHelp.mod/bot_NeonHelp.c +++ b/src/modules/NeonHelp.mod/bot_NeonHelp.c @@ -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; diff --git a/src/modules/NeonServ.mod/bot_NeonServ.c b/src/modules/NeonServ.mod/bot_NeonServ.c index 16d6dbd..4d377e4 100644 --- a/src/modules/NeonServ.mod/bot_NeonServ.c +++ b/src/modules/NeonServ.mod/bot_NeonServ.c @@ -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; diff --git a/src/modules/NeonSpam.mod/bot_NeonSpam.c b/src/modules/NeonSpam.mod/bot_NeonSpam.c index de645c2..16e0016 100644 --- a/src/modules/NeonSpam.mod/bot_NeonSpam.c +++ b/src/modules/NeonSpam.mod/bot_NeonSpam.c @@ -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); -- 2.20.1