Просмотр исходного кода

* Port [3361] to 1.2.14
* Optimize massjoin check a little



svn: 3362

Bryan Drewery 19 лет назад
Родитель
Сommit
d81abe6fe8
1 измененных файлов с 13 добавлено и 13 удалено
  1. 13 13
      src/mod/irc.mod/chan.c

+ 13 - 13
src/mod/irc.mod/chan.c

@@ -2427,19 +2427,6 @@ static int gotjoin(char *from, char *chname)
 	m->user = u;
         m->tried_getuser = 1;
 
-        if (!chk_op(fr, chan) && channel_nomassjoin(chan) && me_op(chan)) {
-          if (chan->channel.drone_jointime < now - chan->flood_mjoin_time) {      //expired, reset counter
-            chan->channel.drone_joins = 0;
-          }
-          ++chan->channel.drone_joins;
-          chan->channel.drone_jointime = now;
-
-          if (!chan->channel.drone_set_mode && chan->channel.drone_joins >= chan->flood_mjoin_thr) {  //flood from dronenet, let's attempt to set +im
-            detected_drone_flood(chan, m);
-          }
-        }
-
-
         if (!m->user && doresolv(chan)) {
           if (is_dotted_ip(host)) 
             strlcpy(m->userip, uhost, sizeof(m->userip));
@@ -2486,6 +2473,19 @@ static int gotjoin(char *from, char *chname)
 	  if (!match_my_nick(chname))
  	    reset_chan_info(chan);
 	} else {
+          /* Check for a mass join */
+          if (channel_nomassjoin(chan) && !chk_op(fr, chan) && me_op(chan)) {
+            if (chan->channel.drone_jointime < now - chan->flood_mjoin_time) {      //expired, reset counter
+              chan->channel.drone_joins = 0;
+            }
+            ++chan->channel.drone_joins;
+            chan->channel.drone_jointime = now;
+
+            if (!chan->channel.drone_set_mode && chan->channel.drone_joins >= chan->flood_mjoin_thr) {  //flood from dronenet, let's attempt to set +im
+              detected_drone_flood(chan, m);
+            }
+          }
+
           irc_log(chan, "Join: %s (%s)", nick, uhost);
 	  set_handle_laston(chan->dname, u, now);
 	}