ソースを参照

getin_request: Handle some exclusions earlier

Bryan Drewery 7 年 前
コミット
a42629cdb5
1 ファイル変更12 行追加12 行削除
  1. 12 12
      src/mod/irc.mod/irc.cc

+ 12 - 12
src/mod/irc.mod/irc.cc

@@ -786,6 +786,18 @@ getin_request(char *botnick, char *code, char *par)
 
     putlog(LOG_GETIN, "*", "opreq from %s/%s on %s - Opped", botnick, nick, chan->dname);
   } else if (what[0] == 'i') {
+    if (mem) {
+      putlog(LOG_GETIN, "*", "inreq from %s/%s for %s - %s is already on %s", botnick, nick, chan->dname, nick, chan->dname);
+      return;
+    }
+
+    get_user_flagrec(u, &fr, chan->dname, chan);
+
+    if (unlikely(!chk_op(fr, chan) || chan_kick(fr) || glob_kick(fr))) {
+      putlog(LOG_GETIN, "*", "inreq from %s/%s for %s - %s doesn't have acces for chan.", botnick, nick, chan->dname, botnick);
+      return;
+    }
+
     // Should I respond to this request?
     // If there's 18 eligible bots in the channel, and in-bots is 2, I have a 2/18 chance of replying.
     int eligible_bots = 0;
@@ -807,18 +819,6 @@ getin_request(char *botnick, char *code, char *par)
       return;
     }
 
-    if (mem) {
-      putlog(LOG_GETIN, "*", "inreq from %s/%s for %s - %s is already on %s", botnick, nick, chan->dname, nick, chan->dname);
-      return;
-    }
-
-    get_user_flagrec(u, &fr, chan->dname, chan);
-
-    if (unlikely(!chk_op(fr, chan) || chan_kick(fr) || glob_kick(fr))) {
-      putlog(LOG_GETIN, "*", "inreq from %s/%s for %s - %s doesn't have acces for chan.", botnick, nick, chan->dname, botnick);
-      return;
-    }
-
     if (chan->channel.mode & CHANKEY) {
       char *key = chan->channel.key[0] ? chan->channel.key : chan->key_prot;
       size_t siz = strlen(chan->dname) + strlen(key ? key : 0) + 6 + 1;