+ bool UmodeEnabled;
+ Override ou;
+ ChanModeReference topiclock;
+ ChanModeReference inviteonly;
+ ChanModeReference key;
+ ChanModeReference limit;
+ Invite::API invapi;
+
+ static bool IsOverride(unsigned int userlevel, const Modes::ChangeList::List& list)
+ {
+ for (Modes::ChangeList::List::const_iterator i = list.begin(); i != list.end(); ++i)
+ {
+ ModeHandler* mh = i->mh;
+ if (mh->GetLevelRequired(i->adding) > userlevel)
+ return true;
+ }
+ return false;
+ }
+
+ ModResult HandleJoinOverride(LocalUser* user, Channel* chan, const std::string& keygiven, const char* bypasswhat, const char* mode)
+ {
+ if (RequireKey && keygiven != "override")
+ {
+ // Can't join normally -- must use a special key to bypass restrictions
+ user->WriteNotice("*** You may not join normally. You must join with a key of 'override' to oper override.");
+ return MOD_RES_PASSTHRU;
+ }
+
+ if (NoisyOverride)
+ chan->WriteRemoteNotice(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;
+ }