]> jfr.im git - irc/quakenet/newserv.git/blobdiff - trusts/data.c
Seperate out db from main module.
[irc/quakenet/newserv.git] / trusts / data.c
index 456699a68009bc500a95baaf83a0a249b3b5faa9..df943a7ab69092303e7f788e7837815f8511042c 100644 (file)
@@ -261,7 +261,7 @@ void th_getsuperandsubsets(uint32_t ip, uint32_t mask, trusthost **superset, tru
   *subset = th_getsubsetbyhost(ip, mask);
 }
 
-void trusts_flush(void) {
+void trusts_flush(void (*thflush)(trusthost *), void (*tgflush)(trustgroup *)) {
   trustgroup *tg;
   trusthost *th;
   time_t t = time(NULL);
@@ -270,13 +270,13 @@ void trusts_flush(void) {
     if(tg->count > 0)
       tg->lastseen = t;
 
-    tg_dbupdatecounts(tg);
+    tgflush(tg);
 
     for(th=tg->hosts;th;th=th->next) {
       if(th->count > 0)
         th->lastseen = t;
 
-      th_dbupdatecounts(th);
+      thflush(th);
     }
   }
 }