]>
Commit | Line | Data |
---|---|---|
1 | #include "chanserv.h" | |
2 | #include "../lib/irc_string.h" | |
3 | #include "../core/schedule.h" | |
4 | ||
5 | void chanservdgline(void* arg) { | |
6 | reguser* rup=(reguser*)arg; | |
7 | nicklist* nl; | |
8 | nick* np; | |
9 | int i; | |
10 | unsigned int ucount; | |
11 | ||
12 | if (!rup) | |
13 | return; | |
14 | ||
15 | for (nl=rup->nicks; nl; nl=nl->next) { | |
16 | for (i=0, ucount=0; i<NICKHASHSIZE; i++) | |
17 | for (np=nicktable[i];np;np=np->next) | |
18 | if (!ircd_strcmp(np->ident, nl->np->ident) && np->ipaddress==nl->np->ipaddress) | |
19 | ucount++; | |
20 | ||
21 | if (ucount >= MAXGLINEUSERS) | |
22 | chanservwallmessage("Delayed GLINE \"*!%s@%s\" (account %s) would hit %d users, aborting.", | |
23 | nl->np->ident, IPtostr(nl->np->ipaddress), rup->username, ucount); | |
24 | else { | |
25 | irc_send("%s GL * +*!%s@%s 3600 :%s\r\n", mynumeric->content, nl->np->ident, | |
26 | IPtostr(nl->np->ipaddress), rup->suspendreason->content); | |
27 | chanservwallmessage("Delayed GLINE \"*!%s@%s\" (authed as %s) expires in 60 minute/s (hit %d user%s) (reason: %s)", | |
28 | nl->np->ident, IPtostr(nl->np->ipaddress), rup->username, ucount, ucount==1?"":"s", rup->suspendreason->content); | |
29 | } | |
30 | } | |
31 | } |