class ModuleOperPrefixMode : public Module
{
- private:
OperPrefixMode opm;
bool mw_added;
HideOperWatcher hideoperwatcher;
{
}
- void init()
+ void init() CXX11_OVERRIDE
{
ServerInstance->Modules->AddService(opm);
mw_added = ServerInstance->Modes->AddModeWatcher(&hideoperwatcher);
}
- ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
+ ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE
{
/* The user may have the +H umode on himself, but +H does not necessarily correspond
* to the +H of m_hideoper.
* conditions (mw_added and the user being +H) together mean the user is a hidden oper.
*/
- if (IS_OPER(user) && (!mw_added || !user->IsModeSet('H')))
+ if (user->IsOper() && (!mw_added || !user->IsModeSet('H')))
privs.push_back('y');
return MOD_RES_PASSTHRU;
}
}
}
- void OnPostOper(User* user, const std::string& opername, const std::string& opertype)
+ void OnPostOper(User* user, const std::string& opername, const std::string& opertype) CXX11_OVERRIDE
{
if (IS_LOCAL(user) && (!mw_added || !user->IsModeSet('H')))
SetOperPrefix(user, true);
}
- void OnLoadModule(Module* mod)
+ void OnLoadModule(Module* mod) CXX11_OVERRIDE
{
if ((!mw_added) && (mod->ModuleSourceFile == "m_hideoper.so"))
mw_added = ServerInstance->Modes->AddModeWatcher(&hideoperwatcher);
}
- void OnUnloadModule(Module* mod)
+ void OnUnloadModule(Module* mod) CXX11_OVERRIDE
{
if ((mw_added) && (mod->ModuleSourceFile == "m_hideoper.so") && (ServerInstance->Modes->DelModeWatcher(&hideoperwatcher)))
mw_added = false;
ServerInstance->Modes->DelModeWatcher(&hideoperwatcher);
}
- Version GetVersion()
+ Version GetVersion() CXX11_OVERRIDE
{
return Version("Gives opers cmode +y which provides a staff prefix.", VF_VENDOR);
}