X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/c424f9fcd68f5bff966422eb8ab0b3b2fb57e894..dad344a7fea8306caf0a3581daf4beb2117ec43b:/trusts/events.c diff --git a/trusts/events.c b/trusts/events.c index b28c33e8..7f716e80 100644 --- a/trusts/events.c +++ b/trusts/events.c @@ -1,15 +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; - host = irc_in_addr_v4_to_int(&sender->p_ipaddr); - th = th_getbyhost(host); + ip_canonicalize_tunnel(&ipaddress, &sender->ipaddress); + + th = th_getbyhost(&ipaddress); settrusthost(sender, th); if(!th) { @@ -70,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;