]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_customprefix.cpp
Allow Timers to delete themselves in Tick()
[user/henk/code/inspircd.git] / src / modules / m_customprefix.cpp
index bda11e8b31761ad932279780322d2d5f08c8baf0..107c6d684b4e0497478e56ed1f417f1e973481a9 100644 (file)
 
 #include "inspircd.h"
 
-class CustomPrefixMode : public ModeHandler
+class CustomPrefixMode : public PrefixMode
 {
  public:
        reference<ConfigTag> tag;
        bool depriv;
 
        CustomPrefixMode(Module* parent, ConfigTag* Tag)
-               : ModeHandler(parent, Tag->getString("name"), 0, PARAM_ALWAYS, MODETYPE_CHANNEL), tag(Tag)
+               : PrefixMode(parent, Tag->getString("name"), 0)
+               , tag(Tag)
        {
-               list = true;
-               m_paramtype = TR_NICK;
                std::string v = tag->getString("prefix");
                prefix = v.c_str()[0];
                v = tag->getString("letter");
@@ -45,11 +44,6 @@ class CustomPrefixMode : public ModeHandler
                        return MOD_RES_ALLOW;
                return MOD_RES_PASSTHRU;
        }
-
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
-       {
-               return MODEACTION_ALLOW;
-       }
 };
 
 class ModuleCustomPrefix : public Module
@@ -75,7 +69,7 @@ class ModuleCustomPrefix : public Module
                        }
                        catch (ModuleException& e)
                        {
-                               throw ModuleException(e.err + " (while creating mode from " + tag->getTagLocation() + ")");
+                               throw ModuleException(e.GetReason() + " (while creating mode from " + tag->getTagLocation() + ")");
                        }
                }
        }