]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_operprefix.cpp
Make various self contained methods static.
[user/henk/code/inspircd.git] / src / modules / m_operprefix.cpp
index 43346a4d033518776de9913c4c7f6dbfd66435d9..3d2a34bdb22425da2cd238987d398c80f559240e 100644 (file)
 
 #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 &parameter, 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;
@@ -79,8 +63,6 @@ class ModuleOperPrefixMode : public Module
 
        void init() CXX11_OVERRIDE
        {
-               ServerInstance->Modules->AddService(opm);
-
                /* To give clients a chance to learn about the new prefix we don't give +y to opers
                 * right now. That means if the module was loaded after opers have joined channels
                 * they need to rejoin them in order to get the oper prefix.