#define UF_WASENFORCED 0x00002000 /* this user was FNCed once already */
#define UF_DEAF 0x00004000 /* user does not receive channel msgs */
#define UF_SERVICE 0x00008000 /* user is a service (e.g. +S on charybdis) */
+#define UF_KLINESENT 0x00010000 /* we've sent a kline for this user */
#define CLIENT_NAME(user) ((user)->uid != NULL ? (user)->uid : (user)->nick)
* not send a KILL. -- jilles */
char reason[BUFSIZE];
snprintf(reason, sizeof(reason), "[#%lu] %s", k->number, k->reason);
- kline_sts("*", k->user, k->host, k->duration ? k->expires - CURRTIME : 0, reason);
+ if (! (u->flags & UF_KLINESENT)) {
+ kline_sts("*", k->user, k->host, k->duration ? k->expires - CURRTIME : 0, reason);
+ u->flags |= UF_KLINESENT;
+ }
}
}
kill_user(si->service->me, cu->user, "%s", reason);
break;
case CLEAR_AKILL:
- if (is_autokline_exempt(cu->user))
+ if (is_autokline_exempt(cu->user)) {
command_success_nodata(si, _("\2CLEARCHAN\2: Not klining exempt user %s!%s@%s"),
cu->user->nick, cu->user->user, cu->user->host);
- else
- kline_sts("*", "*", cu->user->host, 604800, reason);
+ } else {
+ if (! (cu->user->flags & UF_KLINESENT)) {
+ kline_sts("*", "*", cu->user->host, 604800, reason);
+ cu->user->flags |= UF_KLINESENT;
+ }
+ }
}
}
}
}
else
{
- slog(LG_INFO, "CLONES: \2%d\2 clones on \2%s\2 (%s!%s@%s) (TKLINE due to excess clones)", i, u->ip, u->nick, u->user, u->host);
- kline_sts("*", "*", u->ip, kline_duration, "Excessive clones");
+ if (! (u->flags & UF_KLINESENT)) {
+ slog(LG_INFO, "CLONES: \2%d\2 clones on \2%s\2 (%s!%s@%s) (TKLINE due to excess clones)", i, u->ip, u->nick, u->user, u->host);
+ kline_sts("*", "*", u->ip, kline_duration, "Excessive clones");
+ u->flags |= UF_KLINESENT;
+ }
}
}
{
/* match */
command_success_nodata(si, _("\2Match:\2 %s!%s@%s %s - akilling"), u->nick, u->user, u->host, u->gecos);
- kline_sts("*", "*", u->host, 604800, reason);
+ if (! (u->flags & UF_KLINESENT)) {
+ kline_sts("*", "*", u->host, 604800, reason);
+ u->flags |= UF_KLINESENT;
+ }
matches++;
}
}
slog(LG_VERBOSE, "rwatch_newuser(): klining *@%s (user %s!%s@%s matches %s %s)",
u->host, u->nick, u->user, u->host,
rw->regex, rw->reason);
- kline_sts("*", "*", u->host, 86400, rw->reason);
+ if (! (u->flags & UF_KLINESENT)) {
+ kline_sts("*", "*", u->host, 86400, rw->reason);
+ u->flags |= UF_KLINESENT;
+ }
}
}
else if (rw->actions & RWACT_QUARANTINE)
slog(LG_VERBOSE, "rwatch_nickchange(): klining *@%s (user %s -> %s!%s@%s matches %s %s)",
u->host, data->oldnick, u->nick, u->user, u->host,
rw->regex, rw->reason);
- kline_sts("*", "*", u->host, 86400, rw->reason);
+ if (! (u->flags & UF_KLINESENT)) {
+ kline_sts("*", "*", u->host, 86400, rw->reason);
+ u->flags |= UF_KLINESENT;
+ }
}
}
else if (rw->actions & RWACT_QUARANTINE)
}
else if (!strcasecmp("KLINE", action))
{
- slog(LG_INFO, "DNSBL: k-lining \2%s\2!%s@%s [%s] who is listed in DNS Blacklist %s.", u->nick, u->user, u->host, u->gecos, blptr->host);
- /* abort_blacklist_queries(u); */
- notice(svs->nick, u->nick, "Your IP address %s is listed in DNS Blacklist %s", u->ip, blptr->host);
- kline_sts("*", "*", u->host, 86400, "Banned (DNS Blacklist)");
+ if (! (u->flags & UF_KLINESENT)) {
+ slog(LG_INFO, "DNSBL: k-lining \2%s\2!%s@%s [%s] who is listed in DNS Blacklist %s.", u->nick, u->user, u->host, u->gecos, blptr->host);
+ /* abort_blacklist_queries(u); */
+ notice(svs->nick, u->nick, "Your IP address %s is listed in DNS Blacklist %s", u->ip, blptr->host);
+ kline_sts("*", "*", u->host, 86400, "Banned (DNS Blacklist)");
+ u->flags |= UF_KLINESENT;
+ }
return;
}
}