]>
jfr.im git - irc/quakenet/newserv.git/blob - glines/glines.c
1 #include "../irc/irc.h"
3 #include "../trusts/trusts.h"
6 void glinebynick(nick
*np
, int duration
, const char *reason
) {
7 glinebyhost(np
->ident
, IPtostr(np
->p_ipaddr
), duration
, reason
);
10 void glinebyhost(const char *ident
, const char *hostname
, int duration
, const char *reason
) {
11 struct irc_in_addr ip
;
15 if(ipmask_parse(hostname
, &ip
, &bits
)) {
16 th
= th_getbyhost(&ip
);
18 if(th
&& th
->group
->mode
) {
19 trustgline(th
->group
, ident
, duration
, reason
);
24 irc_send("%s GL * +%s@%s %d %jd :%s", mynumeric
->content
, ident
, hostname
, duration
, (intmax_t)getnettime(), reason
);
27 void unglinebyhost(const char *ident
, const char *hostname
, int duration
, const char *reason
) {
28 struct irc_in_addr ip
;
32 if(ipmask_parse(hostname
, &ip
, &bits
)) {
33 th
= th_getbyhost(&ip
);
35 if(th
&& th
->group
->mode
) {
36 trustungline(th
->group
, ident
, duration
, reason
);
41 irc_send("%s GL * -%s@%s %d %jd :%s", mynumeric
->content
, ident
, hostname
, duration
, (intmax_t)getnettime(), reason
);