[eggheads-patches] Bugzilla Bug 348 ".-ban number #channel" not working

Sven Trenkel Sven.Trenkel at tu-clausthal.de
Mon Aug 18 08:49:51 CST 2003


This patch is based on eggdrop v1.6.16+EFnet_E_I.
It should fix bug 348 and mns_exempt and mns_invite. These funktions are
bugged in the same way as mns_ban.
It also contains changes for two different files. That has nothing to do
with bug 348, it is completly unralated.

CU
   Sven
-- 
Today's experiment ..... failed!
-------------- next part --------------
diff -urN eggdrop1.6.original/src/mod/channels.mod/cmdschan.c eggdrop1.6.modified/src/mod/channels.mod/cmdschan.c
--- eggdrop1.6.original/src/mod/channels.mod/cmdschan.c	Mon Mar 24 06:47:07 2003
+++ eggdrop1.6.modified/src/mod/channels.mod/cmdschan.c	Mon Aug 18 15:22:08 2003
@@ -471,18 +471,23 @@
     return;
   }
   if ((i = atoi(ban)) > 0) {
+    /* substract the numer of global bans to get the number of the channel ban */
     egg_snprintf(s, sizeof s, "%d", i);
-    j = u_delban(chan, s, 1);
-    if (j > 0) {
-      if (lastdeletedmask)
-        mask = lastdeletedmask;
-      else
-        mask = s;
-      putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s", dcc[idx].nick, chan->dname,
-             mask);
-      dprintf(idx, "Removed %s channel ban: %s\n", chan->dname, mask);
-      add_mode(chan, '-', 'b', mask);
-      return;
+    j = u_delban(0, s, 0);
+    if (j < 0) {
+      egg_snprintf(s, sizeof s, "%d", -j);
+      j = u_delban(chan, s, 1);
+      if (j > 0) {
+        if (lastdeletedmask)
+          mask = lastdeletedmask;
+        else
+          mask = s;
+        putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s", dcc[idx].nick, chan->dname,
+               mask);
+        dprintf(idx, "Removed %s channel ban: %s\n", chan->dname, mask);
+        add_mode(chan, '-', 'b', mask);
+        return;
+      }
     }
     i = 0;
     for (b = chan->channel.ban; b && b->mask && b->mask[0]; b = b->next) {
@@ -573,18 +578,23 @@
     chan = findchan_by_dname(chname);
   if (chan) {
     if ((i = atoi(exempt)) > 0) {
+      /* substract the numer of global exempts to get the number of the channel exempt */
       egg_snprintf(s, sizeof s, "%d", i);
-      j = u_delexempt(chan, s, 1);
-      if (j > 0) {
-        if (lastdeletedmask)
-          mask = lastdeletedmask;
-        else
-          mask = s;
-        putlog(LOG_CMDS, "*", "#%s# (%s) -exempt %s", dcc[idx].nick,
-               chan->dname, mask);
-        dprintf(idx, "Removed %s channel exempt: %s\n", chan->dname, mask);
-        add_mode(chan, '-', 'e', mask);
-        return;
+      j = u_delexempt(0, s, 0);
+      if (j < 0) {
+        egg_snprintf(s, sizeof s, "%d", -j);
+        j = u_delexempt(chan, s, 1);
+        if (j > 0) {
+          if (lastdeletedmask)
+            mask = lastdeletedmask;
+          else
+            mask = s;
+          putlog(LOG_CMDS, "*", "#%s# (%s) -exempt %s", dcc[idx].nick,
+                 chan->dname, mask);
+          dprintf(idx, "Removed %s channel exempt: %s\n", chan->dname, mask);
+          add_mode(chan, '-', 'e', mask);
+          return;
+        }
       }
       i = 0;
       for (e = chan->channel.exempt; e && e->mask && e->mask[0]; e = e->next) {
@@ -680,18 +690,23 @@
     chan = findchan_by_dname(chname);
   if (chan) {
     if ((i = atoi(invite)) > 0) {
+      /* substract the numer of global invites to get the number of the channel invite */
       egg_snprintf(s, sizeof s, "%d", i);
-      j = u_delinvite(chan, s, 1);
-      if (j > 0) {
-        if (lastdeletedmask)
-          mask = lastdeletedmask;
-        else
-          mask = s;
-        putlog(LOG_CMDS, "*", "#%s# (%s) -invite %s", dcc[idx].nick,
-               chan->dname, mask);
-        dprintf(idx, "Removed %s channel invite: %s\n", chan->dname, mask);
-        add_mode(chan, '-', 'I', mask);
-        return;
+      j = u_delinvite(0, s, 0);
+      if (j < 0) {
+        egg_snprintf(s, sizeof s, "%d", -j);
+        j = u_delinvite(chan, s, 1);
+        if (j > 0) {
+          if (lastdeletedmask)
+            mask = lastdeletedmask;
+          else
+            mask = s;
+          putlog(LOG_CMDS, "*", "#%s# (%s) -invite %s", dcc[idx].nick,
+                 chan->dname, mask);
+          dprintf(idx, "Removed %s channel invite: %s\n", chan->dname, mask);
+          add_mode(chan, '-', 'I', mask);
+          return;
+        }
       }
       i = 0;
       for (inv = chan->channel.invite; inv && inv->mask && inv->mask[0];
diff -urN eggdrop1.6.original/src/mod/irc.mod/chan.c eggdrop1.6.modified/src/mod/irc.mod/chan.c
--- eggdrop1.6.original/src/mod/irc.mod/chan.c	Tue Mar  4 09:51:45 2003
+++ eggdrop1.6.modified/src/mod/irc.mod/chan.c	Mon Aug 18 15:59:26 2003
@@ -2184,7 +2184,7 @@
     get_user_flagrec(u, &fr, chan->dname);
     m = ismember(chan, nick);
     /* Discard -- kick user if it was to the channel */
-    if ((me_op(chan) || (me_halfop(chan) && !chan_hasop(m))) && m &&
+    if (m && (me_op(chan) || (me_halfop(chan) && !chan_hasop(m))) &&
         !chan_sentkick(m) && !chan_friend(fr) && !glob_friend(fr) &&
         !(channel_dontkickops(chan) && (chan_op(fr) || (glob_op(fr) &&
         !chan_deop(fr)))) && !(use_exempts && ban_fun &&
diff -urN eggdrop1.6.original/src/mod/irc.mod/mode.c eggdrop1.6.modified/src/mod/irc.mod/mode.c
--- eggdrop1.6.original/src/mod/irc.mod/mode.c	Sun Mar 16 06:04:33 2003
+++ eggdrop1.6.modified/src/mod/irc.mod/mode.c	Mon Aug 18 15:56:49 2003
@@ -965,7 +965,7 @@
       if (m && channel_active(chan) && (me_op(chan) || (me_halfop(chan) &&
           !chan_hasop(m))) && !(glob_friend(user) || chan_friend(user) ||
           (channel_dontkickops(chan) && (chan_op(user) || (glob_op(user) &&
-          !chan_deop(user))))) && !match_my_nick(from)) {
+          !chan_deop(user))))) && !match_my_nick(nick)) {
         if (chan_fakeop(m) || chan_fakehalfop(m)) {
           putlog(LOG_MODES, ch, CHAN_FAKEMODE, ch);
           dprintf(DP_MODE, "KICK %s %s :%s\n", ch, nick, CHAN_FAKEMODE_KICK);


More information about the Patches mailing list