summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_customprefix.cpp13
-rw-r--r--src/modules/m_ojoin.cpp6
-rw-r--r--src/modules/m_operprefix.cpp6
3 files changed, 6 insertions, 19 deletions
diff --git a/src/modules/m_customprefix.cpp b/src/modules/m_customprefix.cpp
index 67d1d2fe9..d627bbb96 100644
--- a/src/modules/m_customprefix.cpp
+++ b/src/modules/m_customprefix.cpp
@@ -25,8 +25,8 @@ class CustomPrefixMode : public ModeHandler
{
public:
reference<ConfigTag> tag;
- int rank;
bool depriv;
+
CustomPrefixMode(Module* parent, ConfigTag* Tag)
: ModeHandler(parent, Tag->getString("name"), 0, PARAM_ALWAYS, MODETYPE_CHANNEL), tag(Tag)
{
@@ -36,16 +36,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)
@@ -72,7 +67,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());
diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp
index ff92f3fae..999cd5b64 100644
--- a/src/modules/m_ojoin.cpp
+++ b/src/modules/m_ojoin.cpp
@@ -110,11 +110,7 @@ class NetworkPrefix : public ModeHandler
prefix = NPrefix;
levelrequired = INT_MAX;
m_paramtype = TR_NICK;
- }
-
- unsigned int GetPrefixRank()
- {
- return NETWORK_VALUE;
+ prefixrank = NETWORK_VALUE;
}
ModResult AccessCheck(User* source, Channel* channel, std::string &parameter, bool adding)
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index d061a5eab..9c15cf5b2 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -38,11 +38,7 @@ class OperPrefixMode : public ModeHandler
prefix = pfx.empty() ? '!' : pfx[0];
levelrequired = OPERPREFIX_VALUE;
m_paramtype = TR_NICK;
- }
-
- unsigned int GetPrefixRank()
- {
- return OPERPREFIX_VALUE;
+ prefixrank = OPERPREFIX_VALUE;
}
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)