- irc::string x(chan->name.c_str());
- if (!IS_LOCAL(user)->IsInvited(x))
- {
- if (RequireKey && keygiven != "override")
- {
- // Can't join normally -- must use a special key to bypass restrictions
- user->WriteServ("NOTICE %s :*** You may not join normally. You must join with a key of 'override' to oper override.", user->nick.c_str());
- return MOD_RES_PASSTHRU;
- }
-
- if (NoisyOverride)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s used oper override to bypass invite-only", cname, user->nick.c_str());
- ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +i on "+std::string(cname));
- }
+ if (!invapi->IsInvited(user, chan))
+ return HandleJoinOverride(user, chan, keygiven, "invite-only", "+i");