#include "inspircd.h"
+#include "modules/invite.h"
class ModuleOverride : public Module
{
ChanModeReference inviteonly;
ChanModeReference key;
ChanModeReference limit;
+ Invite::API invapi;
static bool IsOverride(unsigned int userlevel, const Modes::ChangeList::List& list)
{
}
if (NoisyOverride)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass %s", chan->name.c_str(), user->nick.c_str(), bypasswhat);
+ chan->WriteNotice(InspIRCd::Format("%s used oper override to bypass %s", user->nick.c_str(), bypasswhat));
ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass " + mode + " on " + chan->name);
return MOD_RES_ALLOW;
}
, inviteonly(this, "inviteonly")
, key(this, "key")
, limit(this, "limit")
+ , invapi(this)
{
}
{
if (chan->IsModeSet(inviteonly) && (CanOverride(user,"INVITE")))
{
- if (!user->IsInvited(chan))
+ if (!invapi->IsInvited(user, chan))
return HandleJoinOverride(user, chan, keygiven, "invite-only", "+i");
return MOD_RES_ALLOW;
}