X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fm_customprefix.cpp;h=65c2cbd31ef572570215aab7df4cdc20ae587ae0;hb=90abe2cd475c8ca2e81626f565d173e9f56d1251;hp=bda11e8b31761ad932279780322d2d5f08c8baf0;hpb=54d10d53c730ab81ca6464fe2f0e0ecbcd435672;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_customprefix.cpp b/src/modules/m_customprefix.cpp index bda11e8b3..65c2cbd31 100644 --- a/src/modules/m_customprefix.cpp +++ b/src/modules/m_customprefix.cpp @@ -19,17 +19,16 @@ #include "inspircd.h" -class CustomPrefixMode : public ModeHandler +class CustomPrefixMode : public PrefixMode { public: reference 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 ¶meter, bool adding) - { - return MODEACTION_ALLOW; - } }; class ModuleCustomPrefix : public Module @@ -75,15 +69,14 @@ 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() + ")"); } } } ~ModuleCustomPrefix() { - for (std::vector::iterator i = modes.begin(); i != modes.end(); i++) - delete *i; + stdalgo::delete_all(modes); } Version GetVersion() CXX11_OVERRIDE