浏览代码

Merge branch 'mdop-improvements'

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

Conflicts:
	doc/UPDATES
Bryan Drewery 14 年之前
父节点
当前提交
f441b8f637
共有 2 个文件被更改,包括 7 次插入0 次删除
  1. 1 0
      doc/UPDATES
  2. 6 0
      src/mod/irc.mod/mode.c

+ 1 - 0
doc/UPDATES

@@ -16,6 +16,7 @@
   * FiSH message support added.
   * FiSH support for DH1080 key-exchange. 'keyx' command added to start from bot, and responds to key-exchanges.
   * Auto FiSH key-exchange when accepting users via callerid
+  * When 'mdop' protection is on, re-op all previously opped clients automatically.
 
 maint
   * Fix --disable-ipv6 compiling

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

@@ -31,6 +31,7 @@
 
 /* Reversing this mode? */
 static bool reversing = 0;
+static bool mdop_reversing = 1;
 
 #  define PLUS    BIT0
 #  define MINUS   BIT1
@@ -636,6 +637,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);
@@ -1093,6 +1098,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");