Przeglądaj źródła

Merge branch 'mdop-improvements' into next

* mdop-improvements:
  * Auto re-op clients if mdop protection is on

Conflicts:
	doc/UPDATES
	src/mod/irc.mod/mode.c
Bryan Drewery 16 lat temu
rodzic
commit
5ab4fa02f2
3 zmienionych plików z 8 dodań i 1 usunięć
  1. 1 0
      doc/UPDATES
  2. 1 1
      src/chanprog.c
  3. 6 0
      src/mod/irc.mod/mode.c

+ 1 - 0
doc/UPDATES

@@ -6,6 +6,7 @@
 * Fix auth IRC lookups getting the wrong cached idx
 * Bot will now jump from the server it's on if it is removed from the server list. (fixes a changing network bug)
 * Fix buffer overflow in DCC
+* When 'mdop' protection is on, re-op all previously opped clients automatically.
 
 * Fix crash related to slowpart
 * Properly honor exemptions when kicking matched RBL clients

+ 1 - 1
src/chanprog.c

@@ -841,7 +841,7 @@ bool bot_shouldjoin(struct userrec* u, struct flag_record* fr, struct chanset_t*
   // No user record, can't make any safe assumptions really
   if (!u) return 0;
 
-#ifdef DEBUG
+#ifdef DEBUGx
   /* Force debugging bots to only join 3 channels */
   if (!strncmp(u->handle, "wtest", 5)) {
     if (!strcmp(chan->dname, "#skynet") || 

+ 6 - 0
src/mod/irc.mod/mode.c

@@ -32,6 +32,7 @@
 /* Reversing this mode? */
 static bool reversing = 0;
 static bool massop = 0;
+static bool mdop_reversing = 1;
 
 #  define PLUS    BIT0
 #  define MINUS   BIT1
@@ -638,6 +639,10 @@ static void
 got_deop(struct chanset_t *chan, memberlist *m, memberlist *mv, char *isserver)
 {
   char s1[UHOSTLEN] = "";
+  const bool was_op = chan_hasop(mv);
+
+  if (mdop_reversing && !was_op)
+    return;
   
   if (m)
     simple_snprintf(s1, sizeof(s1), "%s!%s", m->nick, m->userhost);
@@ -1095,6 +1100,7 @@ gotmode(char *from, char *msg)
                   deflag_user(u, DEFLAG_MDOP, tmp, chan);
                 }
               }
+              reversing = mdop_reversing = 1;
             }
             if (channel_protect(chan))
               do_protect(chan, "Mass Deop");