Prechádzať zdrojové kódy

Allow any user op (+o) to enable/disable EVOICE (#48)

Bryan Drewery 14 rokov pred
rodič
commit
caeb36e375
2 zmenil súbory, kde vykonal 4 pridanie a 4 odobranie
  1. 2 0
      doc/UPDATES
  2. 2 4
      src/mod/irc.mod/mode.c

+ 2 - 0
doc/UPDATES

@@ -1,5 +1,7 @@
 * Bots now again respect devoices made by other bots and will not revoice those users.
 * Add chanset 'voice-moderate' which will auto set +m in '+voice' channel and devoice flooding clients instead of kick. (#48)
+* Bots now will enforce devoices made by ops (user +o) and allow any op (user +o) to revoice to disable that enforcement.
+  This used to use +m to enforce/allowed revoicing.
 
 1.4.0 - http://wraith.botpack.net/milestone/1.4.0
   * Updated server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.

+ 2 - 4
src/mod/irc.mod/mode.c

@@ -1482,8 +1482,7 @@ gotmode(char *from, char *msg)
 
               if (msign == '+') {
                 if (mv->flags & EVOICE) {
-                  /* FIXME: This is a lame check, we need to expand on this more */
-                  if (!chan_master(user) && !glob_master(user) && !chk_voice(victim, chan)) {
+                  if (!chk_op(user, chan) && !chk_voice(victim, chan)) {
                     dv = 1;
                   } else {
                     mv->flags &= ~EVOICE;
@@ -1509,9 +1508,8 @@ gotmode(char *from, char *msg)
                     add_mode(chan, '+', 'v', mparam);
                     /* if they arent +v|v and VOICER is m+ then EVOICE them */
                   } else {
-                    /* FIXME: same thing here */
                     if (!match_my_nick(nick) && channel_voice(chan) &&
-                        (glob_master(user) || chan_master(user) || glob_bot(user)) &&
+                        (chk_op(user, chan) || glob_bot(user)) &&
                         rfc_casecmp(nick, mparam)) {
                       /* if the user is not +q set them norEVOICE. */
                       if (!chan_quiet(victim)) {