[cvslog] (2002-07-22 05:49:04 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Mon Jul 22 00:50:04 CST 2002


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2002-07-22 05:49:04 UTC
Commited by: Jeff Fisher <guppy at techmonkeys.org>

Modified files:
     doc/UPDATES1.6 src/patch.h src/mod/channels.mod/cmdschan.c

Log message:

added Wcc's banlogic patch

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.377 eggdrop1.6/doc/UPDATES1.6:1.378
--- eggdrop1.6/doc/UPDATES1.6:1.377	Mon Jul 22 00:43:27 2002
+++ eggdrop1.6/doc/UPDATES1.6	Mon Jul 22 00:48:52 2002
@@ -1,10 +1,12 @@
-$Id: UPDATES1.6,v 1.377 2002/07/22 05:43:27 guppy Exp $
+$Id: UPDATES1.6,v 1.378 2002/07/22 05:48:52 guppy Exp $
 
 Changes in Eggdrop: (since v1.6.0)
 ----------------------------------
 
 1.6.11
 Found by  Fixed by  What...
+          Wcc       improved the logic in cmd_mnsban when specifying what happen to remove and
+                    where to remove it from
           Eule      fixed cmd_kickban so it works
           Wcc/      fixed a bug causing "[HH:MM] !!! OVER MAXIMUM <queue> QUEUE" to be
           [sL]      logged to LOG_SVROUT
Index: eggdrop1.6/src/mod/channels.mod/cmdschan.c
diff -u eggdrop1.6/src/mod/channels.mod/cmdschan.c:1.55 eggdrop1.6/src/mod/channels.mod/cmdschan.c:1.56
--- eggdrop1.6/src/mod/channels.mod/cmdschan.c:1.55	Thu Jun 13 22:52:34 2002
+++ eggdrop1.6/src/mod/channels.mod/cmdschan.c	Mon Jul 22 00:48:53 2002
@@ -2,7 +2,7 @@
  * cmdschan.c -- part of channels.mod
  *   commands from a user via dcc that cause server interaction
  *
- * $Id: cmdschan.c,v 1.55 2002/06/14 03:52:34 wcc Exp $
+ * $Id: cmdschan.c,v 1.56 2002/07/22 05:48:53 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -421,7 +421,7 @@
 
 static void cmd_mns_ban(struct userrec *u, int idx, char *par)
 {
-  int i = 0, j;
+  int console = 0, i = 0, j;
   struct chanset_t *chan = NULL;
   char s[UHOSTLEN], *ban, *chname;
   masklist *b;
@@ -433,74 +433,80 @@
   ban = newsplit(&par);
   if (par[0] && strchr(CHANMETA, par[0]))
     chname = newsplit(&par);
-  else
+  else {
     chname = dcc[idx].u.chat->con_chan;
+    console = 1;
+  }
   if (chname || !(u->flags & USER_MASTER)) {
     if (!chname)
       chname = dcc[idx].u.chat->con_chan;
     get_user_flagrec(u, &user, chname);
     if (!((glob_op(user) && !chan_deop(user)) || (glob_halfop(user) &&
-	!chan_dehalfop(user)) || chan_op(user) || chan_halfop(user))) {
+        !chan_dehalfop(user)) || chan_op(user) || chan_halfop(user))) {
       dprintf(idx, "You don't have access to remove bans on %s.\n", chname);
       return;
     }
   }
   strncpyz(s, ban, sizeof s);
-  i = u_delban(NULL, s, (u->flags & USER_MASTER));
-  if (i > 0) {
-    putlog(LOG_CMDS, "*", "#%s# -ban %s", dcc[idx].nick, s);
-    dprintf(idx, "%s: %s\n", IRC_REMOVEDBAN, s);
-    for (chan = chanset; chan != NULL; chan = chan->next)
-      add_mode(chan, '-', 'b', s);
-    return;
+  if (console) {
+    i = u_delban(NULL, s, (u->flags & USER_MASTER));
+    if (i > 0) {
+      putlog(LOG_CMDS, "*", "#%s# -ban %s", dcc[idx].nick, s);
+      dprintf(idx, "%s: %s\n", IRC_REMOVEDBAN, s);
+      for (chan = chanset; chan != NULL; chan = chan->next)
+        add_mode(chan, '-', 'b', s);
+      return;
+    }
   }
   /* Channel-specific ban? */
   if (chname)
     chan = findchan_by_dname(chname);
-  if (chan) {
-    if (atoi(ban) > 0) {
-      egg_snprintf(s, sizeof s, "%d", -i);
-      j = u_delban(chan, s, 1);
-      if (j > 0) {
-	putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s", dcc[idx].nick,
-	       chan->dname, s);
-	dprintf(idx, "Removed %s channel ban: %s\n", chan->dname, s);
-	add_mode(chan, '-', 'b', s);
-	return;
-      }
-      i = 0;
-      for (b = chan->channel.ban; b && b->mask && b->mask[0]; b = b->next) {
-	if ((!u_equals_mask(global_bans, b->mask)) &&
-	    (!u_equals_mask(chan->bans, b->mask))) {
-	  i++;
-	  if (i == -j) {
-	    add_mode(chan, '-', 'b', b->mask);
-	    dprintf(idx, "%s '%s' on %s.\n", IRC_REMOVEDBAN,
-		    b->mask, chan->dname);
-	    putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s [on channel]",
-		   dcc[idx].nick, dcc[idx].u.chat->con_chan, ban);
-	    return;
-	  }
-	}
-      }
-    } else {
-      j = u_delban(chan, ban, 1);
-      if (j > 0) {
-	putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s", dcc[idx].nick,
-	       dcc[idx].u.chat->con_chan, ban);
-	dprintf(idx, "Removed %s channel ban: %s\n", chname, ban);
-	add_mode(chan, '-', 'b', ban);
-	return;
+  if (!chan) {
+    dprintf(idx, "Invalid channel.\n");
+    return;
+  }
+  if (atoi(ban) > 0) {
+    egg_snprintf(s, sizeof s, "%d", -i);
+    j = u_delban(chan, s, 1);
+    if (j > 0) {
+      putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s", dcc[idx].nick,
+             chan->dname, s);
+      dprintf(idx, "Removed %s channel ban: %s\n", chan->dname, s);
+      add_mode(chan, '-', 'b', s);
+      return;
+    }
+    i = 0;
+    for (b = chan->channel.ban; b && b->mask && b->mask[0]; b = b->next) {
+      if ((!u_equals_mask(global_bans, b->mask)) &&
+          (!u_equals_mask(chan->bans, b->mask))) {
+        i++;
+        if (i == -j) {
+          add_mode(chan, '-', 'b', b->mask);
+          dprintf(idx, "%s '%s' on %s.\n", IRC_REMOVEDBAN,
+                  b->mask, chan->dname);
+          putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s [on channel]",
+                 dcc[idx].nick, dcc[idx].u.chat->con_chan, ban);
+          return;
+        }
       }
-      for (b = chan->channel.ban; b && b->mask && b->mask[0]; b = b->next) {
-	if (!rfc_casecmp(b->mask, ban)) {
-	  add_mode(chan, '-', 'b', b->mask);
-	  dprintf(idx, "%s '%s' on %s.\n",
-		  IRC_REMOVEDBAN, b->mask, chan->dname);
-	  putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s [on channel]",
-		 dcc[idx].nick, dcc[idx].u.chat->con_chan, ban);
-	  return;
-	}
+    }
+  } else {
+    j = u_delban(chan, ban, 1);
+    if (j > 0) {
+      putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s", dcc[idx].nick,
+             dcc[idx].u.chat->con_chan, ban);
+      dprintf(idx, "Removed %s channel ban: %s\n", chname, ban);
+      add_mode(chan, '-', 'b', ban);
+      return;
+    }
+    for (b = chan->channel.ban; b && b->mask && b->mask[0]; b = b->next) {
+      if (!rfc_casecmp(b->mask, ban)) {
+        add_mode(chan, '-', 'b', b->mask);
+        dprintf(idx, "%s '%s' on %s.\n",
+                IRC_REMOVEDBAN, b->mask, chan->dname);
+        putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s [on channel]",
+               dcc[idx].nick, dcc[idx].u.chat->con_chan, ban);
+        return;
       }
     }
   }
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.783 eggdrop1.6/src/patch.h:1.784
--- eggdrop1.6/src/patch.h:1.783	Mon Jul 22 00:43:28 2002
+++ eggdrop1.6/src/patch.h	Mon Jul 22 00:48:53 2002
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.783 2002/07/22 05:43:28 guppy Exp $
+ * $Id: patch.h,v 1.784 2002/07/22 05:48:53 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1027316784");		/* current unixtime */
+patch("1027316949");		/* current unixtime */
 /*
  *
  *
  */
-patch("kickbanfix");
+patch("mns_ban_fix");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list