]> jfr.im git - irc/quakenet/newserv.git/blobdiff - trusts/events.c
Merge default.
[irc/quakenet/newserv.git] / trusts / events.c
index ca0efdb9322ae808b271540e0f469c27b8aa152d..2f3e56be26eacf00965439f7f1ceb16cc567d2dd 100644 (file)
@@ -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->p_ipaddr);
 
-  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) {
@@ -23,7 +19,6 @@ void trusts_newnick(nick *sender, int moving) {
   } else {
     setnextbytrust(sender, th->users);
     th->users = sender;
-    setipnodebits(sender, th->nodebits);
   }
 
   arg[0] = sender;
@@ -77,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;