]> jfr.im git - irc/quakenet/newserv.git/blobdiff - trusts/trusts_db.c
Rename trusts_cidr2str to CIDRtostr() and move it to lib/irc_ipv6.c.
[irc/quakenet/newserv.git] / trusts / trusts_db.c
index 173ccac2081f8d52a2edc03828e594de9fa7b177..87a9209a0d2ba1e1e6320478c11f038091e25b68 100644 (file)
@@ -45,7 +45,7 @@ void createtrusttables(int mode) {
   trustsdb->createtable(trustsdb, NULL, NULL, "CREATE TABLE ? (id INT PRIMARY KEY, groupid INT, host VARCHAR(?), maxusage INT, created INT, lastseen INT, maxpernode INT, nodebits INT)", "Td", hosts, TRUSTHOSTLEN);
 
   trustsdb->createtable(trustsdb, NULL, NULL,
-    "CREATE TABLE ? (id INT PRIMARY KEY, groupid INT, groupname VARCHAR(?), ts INT, username VARCHAR(?), message VARCHAR(?))",
+    "CREATE TABLE ? (groupid INT, groupname VARCHAR(?), ts INT, username VARCHAR(?), message VARCHAR(?))",
     "Tddd", "log", TRUSTNAMELEN, CREATEDBYLEN, TRUSTLOGLEN
   );
 }
@@ -322,7 +322,7 @@ trustgroup *tg_new(trustgroup *itg) {
 void trustsdb_insertth(char *table, trusthost *th, unsigned int groupid) {
   trustsdb->squery(trustsdb,
     "INSERT INTO ? (id, groupid, host, maxusage, created, lastseen, maxpernode, nodebits) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
-    "Tuusuutuu", table, th->id, groupid, trusts_cidr2str(&th->ip, th->bits), th->maxusage, th->created, th->lastseen, th->maxpernode, th->nodebits
+    "Tuusuutuu", table, th->id, groupid, CIDRtostr(th->ip, th->bits), th->maxusage, th->created, th->lastseen, th->maxpernode, th->nodebits
   );
 }