X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/27ce0548659b866469bb01b639aab0682a4ea667..8c684fca9c7dbb4a2601628c744be9236ee68641:/chanserv/chanservschedule.c diff --git a/chanserv/chanservschedule.c b/chanserv/chanservschedule.c index c935d548..fc44308e 100644 --- a/chanserv/chanservschedule.c +++ b/chanserv/chanservschedule.c @@ -3,29 +3,36 @@ #include "../core/schedule.h" void chanservdgline(void* arg) { - reguser* rup=(reguser*)arg; - nicklist* nl; - nick* np; + reguser *rup=(reguser*)arg; + nick *np, *nl; + authname *anp; int i; unsigned int ucount; - if (!rup) + if (!rup || (!UIsDelayedGline(rup) && !UIsGline(rup))) return; - for (nl=rup->nicks; nl; nl=nl->next) { + if (!(anp=findauthname(rup->ID))) + return; + + for (nl=anp->nicks;nl;nl=nl->nextbyauthname) { for (i=0, ucount=0; inext) - if (!ircd_strcmp(np->ident, nl->np->ident) && np->ipnode==nl->np->ipnode) + if (np->ipnode==nl->ipnode && !ircd_strcmp(np->ident, nl->ident)) ucount++; - if (ucount >= MAXGLINEUSERS) + if (ucount >= MAXGLINEUSERS) { chanservwallmessage("Delayed GLINE \"*!%s@%s\" (account %s) would hit %d users, aborting.", - nl->np->ident, IPtostr(nl->np->p_ipaddr), rup->username, ucount); - else { - irc_send("%s GL * +*!%s@%s 3600 :%s\r\n", mynumeric->content, nl->np->ident, - IPtostr(nl->np->p_ipaddr), rup->suspendreason->content); + nl->ident, IPtostr(nl->p_ipaddr), rup->username, ucount); + } else { + char *reason = "Network abuse"; + if(rup->suspendreason) + reason = rup->suspendreason->content; + + irc_send("%s GL * +*!%s@%s 3600 :%s\r\n", mynumeric->content, nl->ident, + IPtostr(nl->p_ipaddr), reason); chanservwallmessage("Delayed GLINE \"*!%s@%s\" (authed as %s) expires in 60 minute/s (hit %d user%s) (reason: %s)", - nl->np->ident, IPtostr(nl->np->p_ipaddr), rup->username, ucount, ucount==1?"":"s", rup->suspendreason->content); + nl->ident, IPtostr(nl->p_ipaddr), rup->username, ucount, ucount==1?"":"s", reason); } } }