Przeglądaj źródła

Only consider bots that can be opped to have roles

Bryan Drewery 12 lat temu
rodzic
commit
e6e7e686c6
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      src/mod/irc.mod/irc.c

+ 8 - 0
src/mod/irc.mod/irc.c

@@ -1760,6 +1760,7 @@ static void rebalance_roles_chan(struct chanset_t* chan)
   int *bot_bits;
   int *bot_bits;
   short role;
   short role;
   size_t botcount, mappedbot, omappedbot, botidx, roleidx, rolecount;
   size_t botcount, mappedbot, omappedbot, botidx, roleidx, rolecount;
+  struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0 };
   memberlist *m;
   memberlist *m;
 
 
   if (chan->needs_role_rebalance == 0) {
   if (chan->needs_role_rebalance == 0) {
@@ -1772,6 +1773,13 @@ static void rebalance_roles_chan(struct chanset_t* chan)
     if (!member_getuser(m) || !is_bot(m->user)) {
     if (!member_getuser(m) || !is_bot(m->user)) {
       continue;
       continue;
     }
     }
+
+    get_user_flagrec(m->user, &fr, chan->dname, chan);
+
+    /* Only consider bots that can be opped to be roled. */
+    if (!chk_op(fr, chan)) {
+      continue;
+    }
     bots << m->nick;
     bots << m->nick;
   }
   }
   botcount = bots.length();
   botcount = bots.length();