Explorar o código

Handle auto-op in check_expired_chanstuff.

This mitigates join->delay->nick change that wipes out SENTOP in
gotnick.

Fixes #90
Bryan Drewery %!s(int64=10) %!d(string=hai) anos
pai
achega
c0dd240b51
Modificáronse 2 ficheiros con 9 adicións e 1 borrados
  1. 1 0
      doc/UPDATES.md
  2. 8 1
      src/mod/irc.mod/irc.cc

+ 1 - 0
doc/UPDATES.md

@@ -10,6 +10,7 @@
   * Fallback to ISON if the server falsely claims to support MONITOR.
   * Fix bot not auto-opping after just connecting.
   * Fix invites not being applied in -dynamicinvites channels when +i is set.
+  * Fix not handling auto-op in minutely channel rechecks.
 
 # 1.4.6
   * Disable demo TCL support by default to prevent confusion during build.

+ 8 - 1
src/mod/irc.mod/irc.cc

@@ -1584,11 +1584,18 @@ check_expired_chanstuff(struct chanset_t *chan)
 
       if (im_opped) {
         if (dovoice(chan) && !loading) {      /* autovoice of +v users if bot is +y */
+          get_user_flagrec(m->user, &fr, chan->dname, chan);
+
+          /* Autoop */
+          if (!chan_hasop(m) && !chan_sentop(m) && chk_autoop(m, fr, chan)) {
+            do_op(m, chan, 0, 0);
+          }
+
+          /* +v or +voice */
           if (!chan_hasop(m) && !chan_hasvoice(m) && !chan_sentvoice(m)) {
             member_getuser(m, 1);
 
             if (m->user) {
-              get_user_flagrec(m->user, &fr, chan->dname, chan);
               if (!glob_bot(fr)) {
                 if (!(m->flags & EVOICE) &&
                     (