#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;
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);