X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/9813daca730be982a5417ea416f1e1e8a3bf9250..87f58b4ffb83489c7c05af936863126c8afd9ddf:/src/channel.c diff --git a/src/channel.c b/src/channel.c index 8d59a83..c959687 100644 --- a/src/channel.c +++ b/src/channel.c @@ -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; } } }