[eggheads-patches] gotjoin.patch

Axel Franke eule at berlin.snafu.de
Mon Oct 4 15:14:45 CST 1999


-------------- next part --------------
diff -bruN eggdrop1.3/doc/UPDATES1.3 eggneu/doc/UPDATES1.3
--- eggdrop1.3/doc/UPDATES1.3	Mon Oct  4 20:28:37 1999
+++ eggneu/doc/UPDATES1.3	Mon Oct  4 20:30:46 1999
@@ -4,6 +4,7 @@
 
 1.3.29
 Foundby   Fixedby   What....
+dw        Eule      enforcebans with split
           dw        it said 'JOIN flood from @%s!  Banning.'
                     for nick floods.
 reddawg   rtc       md5 make could fail on some OS
diff -bruN eggdrop1.3/src/mod/irc.mod/chan.c eggneu/src/mod/irc.mod/chan.c
--- eggdrop1.3/src/mod/irc.mod/chan.c	Mon Oct  4 20:28:39 1999
+++ eggneu/src/mod/irc.mod/chan.c	Mon Oct  4 20:31:09 1999
@@ -252,7 +252,8 @@
 	  while (m->nick[0]) {
 	    sprintf(s, "%s!%s", m->nick, m->userhost);
 	    if (wild_match(h, s) &&
-		(m->joined >= chan->floodtime[which]) && (!chan_sentkick(m))) {
+		(m->joined >= chan->floodtime[which]) &&
+		   !chan_sentkick(m) && !match_my_nick(m->nick)) {
 	      m->flags |= SENTKICK;
 	      dprintf(DP_SERVER, "KICK %s %s :%s\n", chan->name, m->nick,
 		      IRC_LEMMINGBOT);
@@ -1336,7 +1337,9 @@
 static int gotjoin(char *from, char *chname)
 {
   char *nick, *p, *newmode, buf[UHOSTLEN], *uhost = buf;
+  int ok=1;
   struct chanset_t *chan;
+  masklist *b, *e;
   memberlist *m;
   struct userrec *u;
   struct flag_record fr =
@@ -1514,6 +1517,24 @@
 	  set_handle_laston(chname, u, now);
 	}
       }
+	  
+	  if (channel_enforcebans(chan) && me_op(chan) &&
+	    !chan_op(fr) && !glob_op(fr)) {
+	   for (b = chan->channel.ban; b->mask[0]; b = b->next) {
+	    if (wild_match(b->mask, from)) {
+		 if (use_exempts)
+		  for (e = chan->channel.exempt; e->mask[0]; e = e->next)
+		   if (wild_match(e->mask, from))
+		     ok=0;
+		 if (ok && !chan_sentkick(m)) {
+		  dprintf(DP_SERVER, "KICK %s %s :%s\n", chname, m->nick,
+		      IRC_YOUREBANNED);
+		  m->flags |= SENTKICK;
+		 }
+		}
+	   }
+	  }
+
     }
   }
   return 0;


More information about the Patches mailing list