X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fmodules%2FNeonServ.mod%2Fevent_neonserv_mode.c;h=b6d06527e1ca04fdd4ad9470355d726158515159;hb=b3c0421db9c607c841b8926725dfab5323872a87;hp=79264931d1298b08d241547c8c360d2ac131bb0e;hpb=414e6b1adccc5113a6cbe1539b8abeeec4f3b1ff;p=NeonServV5.git diff --git a/src/modules/NeonServ.mod/event_neonserv_mode.c b/src/modules/NeonServ.mod/event_neonserv_mode.c index 7926493..b6d0652 100644 --- a/src/modules/NeonServ.mod/event_neonserv_mode.c +++ b/src/modules/NeonServ.mod/event_neonserv_mode.c @@ -201,16 +201,30 @@ static void neonserv_event_mode_async1(struct ClientSocket *client, struct UserN reply(textclient, user, "NS_MODE_CANBAN", chan->name); db_canban = -1; } + char hostmask_buffer[NICKLEN+USERLEN+HOSTLEN+3]; + char usermask[NICKLEN+USERLEN+HOSTLEN+3]; + int match_count = 0; if(db_canban == -1) { - if(!neonserv_cmd_mode_botwar_detect(client, user, chan, &botwar_detect_executed)) + if(!neonserv_cmd_mode_botwar_detect(client, user, chan, &botwar_detect_executed)) { + if(!add) { + //check if a user just removed a bot ban + for(chanuser = getChannelUsers(chan, NULL); chanuser; chanuser = getChannelUsers(chan, chanuser)) { + cuser = chanuser->user; + sprintf(usermask, "%s!%s@%s", cuser->nick, cuser->ident, cuser->host); + if(!match(carg, usermask) && isBot(cuser)) { + skip = 1; + break; + } + } + if(skip) + break; + } modeBufferSet(modeBuf, !add, modes[i], carg); + } if(uaccess < db_getop) deop_user = 1; break; } - char hostmask_buffer[NICKLEN+USERLEN+HOSTLEN+3]; - char usermask[NICKLEN+USERLEN+HOSTLEN+3]; - int match_count = 0; carg = make_banmask(carg, hostmask_buffer); if(add) { for(chanuser = getChannelUsers(chan, NULL); chanuser; chanuser = getChannelUsers(chan, chanuser)) {