[eggheads-patches] PATCH: botban.patch

Peter 'Rattacresh' Backes rtc at rhrk.uni-kl.de
Tue Oct 12 18:30:02 CST 1999


* Bot could ban itself and it didn't revert. (.dump MODE for example)
* In some situations, other people could ban the bot and it didn't 
revert, too. (dunno, maybe if mask matched other owners/masters/etc. 
on the channel or if the banned person didn't have an useracct???)


-- Peter 'Rattacresh' Backes, rtc at rhrk.uni-kl.de

-------------- next part --------------
diff -urN eggdrop1.3.29/doc/UPDATES1.3 eggdrop1.3.29+botban/doc/UPDATES1.3
--- eggdrop1.3.29/doc/UPDATES1.3	Tue Oct 12 23:58:01 1999
+++ eggdrop1.3.29+botban/doc/UPDATES1.3	Tue Oct 12 23:58:46 1999
@@ -4,6 +4,7 @@
 
 1.3.29
 Foundby   Fixedby   What....
+          rtc       bot sometimes didn't reverse if it got banned
 	  CyberTech Fixed pver length into init_tcl().
 	  drummer   Adds ismodeline macros.
 ranjha	  Fabian    .help * is now converted to .help all
diff -urN eggdrop1.3.29/src/mod/irc.mod/mode.c eggdrop1.3.29+botban/src/mod/irc.mod/mode.c
--- eggdrop1.3.29/src/mod/irc.mod/mode.c	Tue Oct 12 23:58:04 1999
+++ eggdrop1.3.29+botban/src/mod/irc.mod/mode.c	Tue Oct 12 23:51:22 1999
@@ -516,7 +516,15 @@
   newban(chan, who, s);
   bogus = 0;
   check = 1;
-  if (!match_my_nick(nick)) {	/* it's not my ban */
+  if (wild_match(who, me) && me_op(chan)) {
+    /* First of all let's check whether some luser banned us ++rtc */
+    if (match_my_nick(nick)) {
+      /* Bot banned itself -- doh! ++rtc */
+      putlog(LOG_MISC, "*", "Uh, banned myself on %s, reversing...", chan->name);
+    }
+    reversing = 1;
+    check = 0;
+  } else if (!match_my_nick(nick)) {	/* it's not my ban */
     if (channel_nouserbans(chan) && nick[0] && !glob_bot(user) &&
 	!glob_master(user) && !chan_master(user)) {
       /* no bans made by users */
@@ -586,10 +594,6 @@
 	}
 	if (glob_master(victim) || chan_master(victim))
 	  check = 0;
-      } else if (wild_match(who, me) && me_op(chan)) {
-	/* ^ don't really feel like being banned today, thank you! */
-	reversing = 1;
-	check = 0;
       }
     } else {
       /* banning an oplisted person who's on the channel? */


More information about the Patches mailing list