X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_operprefix.cpp;h=3d2a34bdb22425da2cd238987d398c80f559240e;hb=d736eba00b274c87662bd73a3acf8288135643d6;hp=23390baea5fe6331d4c141cbb46b68cd813f0e57;hpb=992674362c5f64bdb8e1942eeaa7612524529cd6;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp index 23390baea..3d2a34bdb 100644 --- a/src/modules/m_operprefix.cpp +++ b/src/modules/m_operprefix.cpp @@ -26,32 +26,16 @@ #define OPERPREFIX_VALUE 1000000 -class OperPrefixMode : public ModeHandler +class OperPrefixMode : public PrefixMode { public: - OperPrefixMode(Module* Creator) : ModeHandler(Creator, "operprefix", 'y', PARAM_ALWAYS, MODETYPE_CHANNEL) + OperPrefixMode(Module* Creator) : PrefixMode(Creator, "operprefix", 'y') { std::string pfx = ServerInstance->Config->ConfValue("operprefix")->getString("prefix", "!"); - list = true; prefix = pfx.empty() ? '!' : pfx[0]; - levelrequired = OPERPREFIX_VALUE; - m_paramtype = TR_NICK; + levelrequired = INT_MAX; prefixrank = OPERPREFIX_VALUE; } - - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) - { - if (IS_SERVER(source) || ServerInstance->ULine(source->server)) - return MODEACTION_ALLOW; - else - { - if (channel) - source->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :Only servers are permitted to change channel mode '%c'", source->nick.c_str(), channel->name.c_str(), 'y'); - return MODEACTION_DENY; - } - } - - bool NeedsOper() { return true; } }; class ModuleOperPrefixMode;