#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));
return;
}
- if (huser_get_level(husr) > H_PEON && (huser_get_account_flags(husr) & H_AUTO_OP) && hchannel_authority(hchan, husr))
+ if (huser_get_level(husr) >= H_STAFF && (huser_get_account_flags(husr) & H_AUTO_OP) && hchannel_authority(hchan, husr))
helpmod_channick_modes(husr, hchan ,MC_OP,HNOW);
- if (huser_get_level(husr) > H_PEON && (huser_get_account_flags(husr) & H_AUTO_VOICE) && hchannel_authority(hchan, husr))
+ if (huser_get_level(husr) >= H_TRIAL && (huser_get_account_flags(husr) & H_AUTO_VOICE) && hchannel_authority(hchan, husr))
helpmod_channick_modes(husr, hchan, MC_VOICE,HNOW);
if (hchan->flags & H_WELCOME && *hchan->real_channel->index->name->content)
if (hchan->flags & H_PASSIVE)
return;
- if (huser_get_level(husr) == H_LAMER || (huser_get_level(husr) == H_PEON && hban_check(nck)))
+ huser_activity(husr, NULL);
+
+ if (huser_get_level(husr) == H_LAMER || (huser_get_level(husr) <= H_TRIAL && hban_check(nck)))
{
hban *hb = hban_check(nck);
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));
assert(huserchan != NULL);
huserchan->flags &= ~HCUMODE_OP;
-
}
static void helpmod_hook_channel_voiced(int unused, void *args)
{
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);
+ husr->account = haccount_get_by_name(nck->authname);
+
+ 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 */