Просмотр исходного кода

* Fixed a possible loop of -v+v with +voice/+v

svn: 2085
Bryan Drewery 21 лет назад
Родитель
Сommit
0817a78fe8
3 измененных файлов с 6 добавлено и 2 удалено
  1. 1 0
      doc/UPDATES
  2. 4 1
      src/mod/irc.mod/chan.c
  3. 1 1
      src/mod/irc.mod/mode.c

+ 1 - 0
doc/UPDATES

@@ -117,6 +117,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Several cmds were not saving userfile: -/+chrec|ban|exempt|invite, [un]stick, chinfo (#68)
 * Added ability to +chan/chanset flood-* x:n (#69)
 * Fixed bots kicking with +bitch responses when a +d user is opped.
+* Fixed a possible loop of -v+v with +voice/+v
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 4 - 1
src/mod/irc.mod/chan.c

@@ -960,8 +960,11 @@ static void check_this_member(struct chanset_t *chan, char *nick, struct flag_re
           add_mode(chan, '-', 'v', m->nick);
       } else if (!chan_hasvoice(m) && !chan_hasop(m)) {
         /* voice +v users */
-        if (chk_voice(*fr, chan))
+        if (chk_voice(*fr, chan)) {
           add_mode(chan, '+', 'v', m->nick);
+          if (m->flags & EVOICE)
+            m->flags &= ~EVOICE;
+        }
       }
     }
   }

+ 1 - 1
src/mod/irc.mod/mode.c

@@ -1347,7 +1347,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)) {
+                  if (!chan_master(user) && !glob_master(user) && !chk_voice(victim, chan)) {
                     dv = 1;
                   } else {
                     mv->flags &= ~EVOICE;