#include <string.h>
#include <assert.h>
-#include "../core/hooks.h"
-#include "../localuser/localuser.h"
-
#include "helpmod.h"
#include "hchannel.h"
#include "haccount.h"
else
hchan->jf_control++;
- if (hchan->jf_control - time(NULL) > 20 && !IsRegOnly(hchan))
+ if (hchan->jf_control - time(NULL) > 12 && !IsRegOnly(hchan))
{
if (hchan->flags & H_REPORT && hchannel_is_valid(hchan->report_to))
helpmod_message_channel(hchan->report_to, "Warning: Possible join flood on %s, setting +r", hchannel_get_name(hchan));
helpmod_setban(hchan, banmask, time(NULL) + 1 * HDEF_d, MCB_ADD, HNOW);
if (hb)
- helpmod_kick(hchan, husr,hban_get_reason(hb));
+ helpmod_kick(hchan, husr, "%s", hban_get_reason(hb));
else
helpmod_kick(hchan, husr, "Your presence on channel %s is not wanted", hchannel_get_name(hchan));
{
nick *nck = (nick*)args;
huser *husr = huser_get(nck);
+ huser_channel *huserchan, *huserchannext;
if (husr == NULL)
return;
else
husr->account = haccount_get_by_name(nck->authname);
- if (huser_get_level(husr) == H_LAMER)
- while (husr->hchannels)
- helpmod_kick(husr->hchannels->hchan, husr, "Your presence on channel %s is not wanted", hchannel_get_name(husr->hchannels->hchan));
+ if (huser_get_level(husr) == H_LAMER) {
+ for (huserchan = husr->hchannels; huserchan; huserchan = huserchannext) {
+ huserchannext = huserchan->next;
+ helpmod_kick(huserchan->hchan, husr, "Your presence on channel %s is not wanted", hchannel_get_name(huserchan->hchan));
+ }
+ }
}
static void helpmod_hook_server_newserver(int unused, void *args)
{
hchannel *hchan;
- int numeric = (int)args;
+ long numeric = (long)args;
server srv = serverlist[numeric];
/* check linkstate to prevent spam */