]> 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 8d59a83a9432fa925a16ea49e46e50008ff416fc..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"
@@ -240,8 +241,6 @@ remove_user_from_channel(struct membership *msptr)
        if(client_p->servptr == &me)
                rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers);
 
-       chptr->users_last = rb_current_time();
-
        if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0)
                destroy_channel(chptr);
 
@@ -277,8 +276,6 @@ remove_user_from_channels(struct Client *client_p)
                if(client_p->servptr == &me)
                        rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers);
 
-               chptr->users_last = rb_current_time();
-
                if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0)
                        destroy_channel(chptr);
 
@@ -921,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;
                }
        }
@@ -944,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;
@@ -999,6 +993,7 @@ check_splitmode(void *unused)
                                             "Network rejoined, deactivating splitmode");
 
                        rb_event_delete(check_splitmode_ev);
+                       check_splitmode_ev = NULL;
                }
        }
 }