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

Merge branch 'no-desync-kick-friends' into next

* no-desync-kick-friends:
  * Don't kick friendly bots that are desynced: op them.

Conflicts:
	doc/UPDATES
Bryan Drewery 15 лет назад
Родитель
Сommit
83c72fc8fa
2 измененных файлов с 10 добавлено и 4 удалено
  1. 1 0
      doc/UPDATES
  2. 9 4
      src/mod/irc.mod/mode.c

+ 1 - 0
doc/UPDATES

@@ -4,6 +4,7 @@ next
   * When 'mop' protection is on, deop all previously regular clients automatically.
   * Fix 'mop' causing a mass deop when -bitch
   * Properly honor exemptions when kicking matched RBL clients
+  * Don't kick friendly bots that are desynced: op them.
 
 release
   * Add an extra 2 second delay before releasing nick to aide in syncing and time to type /nick

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

@@ -1263,10 +1263,15 @@ gotmode(char *from, char *msg)
           m->flags |= SENTKICK;
           reversing = 1;
         } else if (!chan_hasop(m) && !channel_nodesynch(chan)) {
-          putlog(LOG_MODES, ch, "Mode change by non-chanop on %s!  Reversing...", ch);
-          dprintf(DP_MODE, "KICK %s %s :%sAbusing desync\n", ch, m->nick, kickprefix);
-          m->flags |= SENTKICK;
-          reversing = 1;
+          if (u && u->bot && chk_op(user, chan)) {
+            putlog(LOG_MODES, ch, "Mode change by friendly non-chanop on %s!  Opping...", ch);
+            do_op(m->nick, chan, 0, 0);
+          } else {
+            putlog(LOG_MODES, ch, "Mode change by non-chanop on %s!  Reversing...", ch);
+            dprintf(DP_MODE, "KICK %s %s :%sAbusing desync\n", ch, m->nick, kickprefix);
+            m->flags |= SENTKICK;
+            reversing = 1;
+          }
         }
       }