]>
Commit | Line | Data |
---|---|---|
6e6e98da | 1 | #include <stdio.h> |
813c5b73 | 2 | #include <../nick/nick.h> |
ac3af088 | 3 | #include "../irc/irc.h" |
813c5b73 CP |
4 | #include "trusts.h" |
5 | ||
6 | int istrusted(nick *np) { | |
7 | return gettrusthost(np) != NULL; | |
8 | } | |
ac3af088 GB |
9 | |
10 | int trustgline(trustgroup *tg, const char *ident, int duration, const char *reason) { | |
11 | trusthost *th; | |
12 | int count = 0; | |
13 | ||
14 | for(th=tg->hosts;th;th=th->next) { | |
6e6e98da | 15 | char *cidrstr = trusts_cidr2str(&th->ip, th->bits); |
ac3af088 GB |
16 | irc_send("%s GL * +%s@%s %d %jd :%s", mynumeric->content, ident, cidrstr, duration, (intmax_t)getnettime(), reason); |
17 | count++; | |
18 | } | |
19 | ||
20 | return count; | |
21 | } | |
22 | ||
23 | int trustungline(trustgroup *tg, const char *ident, int duration, const char *reason) { | |
24 | trusthost *th; | |
25 | int count = 0; | |
26 | ||
27 | for(th=tg->hosts;th;th=th->next) { | |
6e6e98da | 28 | char *cidrstr = trusts_cidr2str(&th->ip, th->bits); |
ac3af088 GB |
29 | irc_send("%s GL * +%s@%s %d %jd :%s", mynumeric->content, ident, cidrstr, duration, (intmax_t)getnettime(), reason); |
30 | count++; | |
31 | } | |
32 | ||
33 | return count; | |
34 | } |