]> jfr.im git - irc/quakenet/newserv.git/commitdiff
whowas: Track users' IP addresses.
authorGunnar Beutner <redacted>
Sun, 4 Aug 2013 23:07:52 +0000 (01:07 +0200)
committerGunnar Beutner <redacted>
Sun, 4 Aug 2013 23:07:52 +0000 (01:07 +0200)
--HG--
branch : shroudtrusts

whowas/whowas.c
whowas/whowas.h
whowas/whowas_commands.c

index d9b8c50fdbd0ba703004fa5aad22aa080855fd1c..439caea9b76c29e7354260954b2d7f620289bc1d 100644 (file)
@@ -21,6 +21,7 @@ whowas *whowas_fromnick(nick *np) {
   strncpy(ww->nick, np->nick, NICKLEN);
   strncpy(ww->ident, np->ident, USERLEN);
   strncpy(ww->host, np->host->name->content, HOSTLEN);
+  memcpy(&ww->ip, &np->p_ipaddr, sizeof(struct irc_in_addr));
   strncpy(ww->realname, np->realname->name->content, REALLEN);
   ww->seen = getnettime();
 
index 9b679ab0be4bf1c5d5c6ad37a2239653d77e58ba..ccd40298d7f44a4e579edaf2f45c98cb5c40d4ba 100644 (file)
@@ -8,6 +8,7 @@ typedef struct whowas {
   char nick[NICKLEN + 1];
   char ident[USERLEN + 1];
   char host[HOSTLEN + 1];
+  struct irc_in_addr ip;
   char realname[REALLEN + 1];
 
   int type;
index 778943100178ed5e6473173bef391dc468a8d7ef..7643cdb48b40fcc22d231ff628372e3936a0dc74 100644 (file)
@@ -13,7 +13,7 @@ static void whowas_spewrecord(whowas *ww, nick *np) {
   char timebuf[30];
   char hostmask[WW_MASKLEN + 1];
 
-  snprintf(hostmask, sizeof(hostmask), "%s!%s@%s", ww->nick, ww->ident, ww->host);
+  snprintf(hostmask, sizeof(hostmask), "%s!%s@%s [%s]", ww->nick, ww->ident, ww->host, IPtostr(ww->ip));
   strftime(timebuf, 30, "%d/%m/%y %H:%M:%S", localtime(&(ww->seen)));
 
   if (ww->type == WHOWAS_RENAME)