瀏覽代碼

Only consider bots that can be opped to have roles

Bryan Drewery 12 年之前
父節點
當前提交
e6e7e686c6
共有 1 個文件被更改,包括 8 次插入0 次删除
  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;
   short role;
   size_t botcount, mappedbot, omappedbot, botidx, roleidx, rolecount;
+  struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0 };
   memberlist *m;
 
   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)) {
       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;
   }
   botcount = bots.length();