X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_customprefix.cpp;h=bda11e8b31761ad932279780322d2d5f08c8baf0;hb=e950f568d0f571e9475aa38177486468714de4d3;hp=6f9f4da28635e8e0d8f7aa1847e2a83605291861;hpb=9bb24d3f458274b7485554bc95f1274900a69ec2;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_customprefix.cpp b/src/modules/m_customprefix.cpp index 6f9f4da28..bda11e8b3 100644 --- a/src/modules/m_customprefix.cpp +++ b/src/modules/m_customprefix.cpp @@ -19,14 +19,12 @@ #include "inspircd.h" -/* $ModDesc: Allows custom prefix modes to be created. */ - class CustomPrefixMode : public ModeHandler { public: reference tag; - int rank; bool depriv; + CustomPrefixMode(Module* parent, ConfigTag* Tag) : ModeHandler(parent, Tag->getString("name"), 0, PARAM_ALWAYS, MODETYPE_CHANNEL), tag(Tag) { @@ -36,16 +34,11 @@ class CustomPrefixMode : public ModeHandler prefix = v.c_str()[0]; v = tag->getString("letter"); mode = v.c_str()[0]; - rank = tag->getInt("rank"); - levelrequired = tag->getInt("ranktoset", rank); + prefixrank = tag->getInt("rank"); + levelrequired = tag->getInt("ranktoset", prefixrank); depriv = tag->getBool("depriv", true); } - unsigned int GetPrefixRank() - { - return rank; - } - ModResult AccessCheck(User* src, Channel*, std::string& value, bool adding) { if (!adding && src->nick == value && depriv) @@ -53,10 +46,6 @@ class CustomPrefixMode : public ModeHandler return MOD_RES_PASSTHRU; } - void RemoveMode(User* user, irc::modestacker* stack) - { - } - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) { return MODEACTION_ALLOW; @@ -76,7 +65,7 @@ class ModuleCustomPrefix : public Module tags.first++; CustomPrefixMode* mh = new CustomPrefixMode(this, tag); modes.push_back(mh); - if (mh->rank <= 0) + if (mh->GetPrefixRank() == 0) throw ModuleException("Rank must be specified for prefix at " + tag->getTagLocation()); if (!isalpha(mh->GetModeChar())) throw ModuleException("Mode must be a letter for prefix at " + tag->getTagLocation());