Przeglądaj źródła

chk_autoop: Refactor slightly to allow expanding for homechan op.

Note that m->user is not actually needed explicitly here for
authorization since 'fr' will sitll need proper op bit set.
Bryan Drewery 7 lat temu
rodzic
commit
56e5f6d5d9
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      src/flags.cc

+ 3 - 2
src/flags.cc

@@ -478,9 +478,10 @@ real_chk_op(const struct flag_record fr, const struct chanset_t *chan, bool botb
 int
 chk_autoop(memberlist *m, const struct flag_record fr, const struct chanset_t *chan)
 {
-  if (glob_bot(fr) || !chan || !m->user || u_pass_match(m->user, "-"))
+  if (glob_bot(fr) || !chan || (m->user && u_pass_match(m->user, "-")) ||
+      channel_take(chan) || privchan(fr, chan, PRIV_OP) || chk_deop(fr, chan))
     return 0;
-  if (!channel_take(chan) && !privchan(fr, chan, PRIV_OP) && chk_op(fr, chan) && !chk_deop(fr, chan)) {
+  if (chk_op(fr, chan)) {
     if (channel_autoop(chan) || chan_autoop(fr) || glob_autoop(fr))
       return 1;
   }