X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/3a801ca49f68ff4a8e6b16cf87e6a591ebfbbf5d..dad344a7fea8306caf0a3581daf4beb2117ec43b:/trusts/events.c diff --git a/trusts/events.c b/trusts/events.c index 797fc4ba..7f716e80 100644 --- a/trusts/events.c +++ b/trusts/events.c @@ -1,21 +1,17 @@ #include "../core/hooks.h" +#include "../irc/irc.h" #include "trusts.h" static void __counthandler(int hooknum, void *arg); void trusts_newnick(nick *sender, int moving) { - uint32_t host; trusthost *th; void *arg[2]; struct irc_in_addr ipaddress; - ip_canonicalize_6to4(&ipaddress, &sender->p_ipaddr); + ip_canonicalize_tunnel(&ipaddress, &sender->ipaddress); - if (irc_in_addr_is_ipv4(&ipaddress)) { - host = irc_in_addr_v4_to_int(&ipaddress); - th = th_getbyhost(host); - } else - th = NULL; + th = th_getbyhost(&ipaddress); settrusthost(sender, th); if(!th) { @@ -76,7 +72,7 @@ static void __lostnick(int hooknum, void *arg) { } static void __counthandler(int hooknum, void *arg) { - time_t t = time(NULL); + time_t t = getnettime(); void **args = arg; trusthost *th = gettrusthost((nick *)args[0]); trustgroup *tg;