]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/channel.c
Add umode +V, which blocks invites to anyone with it set.
[irc/rqf/shadowircd.git] / src / channel.c
index e3e2c060b4f3f827ad0732c784453cf48bb3591a..c959687a57d0c79742ec5b72c4bd77e51d36a878 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "stdinc.h"
 #include "channel.h"
+#include "chmode.h"
 #include "client.h"
 #include "common.h"
 #include "hash.h"
@@ -917,19 +918,14 @@ check_spambot_warning(struct Client *source_p, const char *name)
                        source_p->localClient->oper_warn_count_down--;
                else
                        source_p->localClient->oper_warn_count_down = 0;
-               if(source_p->localClient->oper_warn_count_down == 0)
+               if(source_p->localClient->oper_warn_count_down == 0 &&
+                               name != NULL)
                {
                        /* Its already known as a possible spambot */
-                       if(name != NULL)
-                               sendto_realops_snomask(SNO_BOTS, L_NETWIDE,
-                                                    "User %s (%s@%s) trying to join %s is a possible spambot",
-                                                    source_p->name,
-                                                    source_p->username, source_p->orighost, name);
-                       else
-                               sendto_realops_snomask(SNO_BOTS, L_NETWIDE,
-                                                    "User %s (%s@%s) is a possible spambot",
-                                                    source_p->name,
-                                                    source_p->username, source_p->orighost);
+                       sendto_realops_snomask(SNO_BOTS, L_NETWIDE,
+                                            "User %s (%s@%s) trying to join %s is a possible spambot",
+                                            source_p->name,
+                                            source_p->username, source_p->orighost, name);
                        source_p->localClient->oper_warn_count_down = OPER_SPAM_COUNTDOWN;
                }
        }
@@ -940,7 +936,9 @@ check_spambot_warning(struct Client *source_p, const char *name)
                   JOIN_LEAVE_COUNT_EXPIRE_TIME)
                {
                        decrement_count = (t_delta / JOIN_LEAVE_COUNT_EXPIRE_TIME);
-                       if(decrement_count > source_p->localClient->join_leave_count)
+                       if(name != NULL)
+                               ;
+                       else if(decrement_count > source_p->localClient->join_leave_count)
                                source_p->localClient->join_leave_count = 0;
                        else
                                source_p->localClient->join_leave_count -= decrement_count;