]> jfr.im git - irc/quakenet/newserv.git/blobdiff - chanserv/chanserv_protect.c
move some more data/log paths missed before
[irc/quakenet/newserv.git] / chanserv / chanserv_protect.c
index b727f4196c5158a750781ee1fe6c86f25a5d8df1..1833db68830bade59229bb547aa9f3d75e54dd63 100644 (file)
@@ -2,10 +2,11 @@
  * Nick protection system for the chanserv
  */
 
+#include <stdio.h>
 #include "chanserv.h"
 #include "../core/schedule.h"
 #include "../localuser/localuser.h"
-
+#include "../lib/irc_string.h"
 
 #define PROTECTTIME    60 /* How long you have to renick if you encroach.. */
 
@@ -51,6 +52,7 @@ void _fini() {
 void csp_handlenick(int hooknum, void *arg) {
   nick *np=arg;
   reguser *rup;
+  char userhostbuf[USERLEN+HOSTLEN+2];
 
   /* Check that it's a protected nick */
   if (!(rup=findreguserbynick(np->nick)) || !UIsProtect(rup))
@@ -70,6 +72,12 @@ void csp_handlenick(int hooknum, void *arg) {
     rup->stealcount=0;
     return;
   }
+  
+  if (rup->lastuserhost) {
+    sprintf(userhostbuf,"%s@%s",np->ident,np->host->name->content);
+    if (!ircd_strcmp(userhostbuf, rup->lastuserhost->content))
+      return;
+  }
 
   if (IsOper(np) || homeserver(np->numeric)==mylongnum)
     return;