summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_auditorium.cpp2
-rw-r--r--src/modules/m_autoop.cpp4
-rw-r--r--src/modules/m_customprefix.cpp3
-rw-r--r--src/modules/m_delayjoin.cpp2
-rw-r--r--src/modules/m_delaymsg.cpp2
-rw-r--r--src/modules/m_ojoin.cpp2
-rw-r--r--src/modules/m_operprefix.cpp2
-rw-r--r--src/modules/m_override.cpp2
-rw-r--r--src/modules/m_rmode.cpp2
9 files changed, 11 insertions, 10 deletions
diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp
index 692b3eba4..7acbd2fff 100644
--- a/src/modules/m_auditorium.cpp
+++ b/src/modules/m_auditorium.cpp
@@ -28,7 +28,7 @@ class AuditoriumMode : public SimpleChannelModeHandler
public:
AuditoriumMode(Module* Creator) : SimpleChannelModeHandler(Creator, "auditorium", 'u')
{
- levelrequired = OP_VALUE;
+ ranktoset = ranktounset = OP_VALUE;
}
};
diff --git a/src/modules/m_autoop.cpp b/src/modules/m_autoop.cpp
index 8c7f300da..257c3647c 100644
--- a/src/modules/m_autoop.cpp
+++ b/src/modules/m_autoop.cpp
@@ -28,7 +28,7 @@ class AutoOpList : public ListModeBase
public:
AutoOpList(Module* Creator) : ListModeBase(Creator, "autoop", 'w', "End of Channel Access List", 910, 911, true)
{
- levelrequired = OP_VALUE;
+ ranktoset = ranktounset = OP_VALUE;
tidy = false;
}
@@ -61,7 +61,7 @@ class AutoOpList : public ListModeBase
std::string dummy;
if (mh->AccessCheck(source, channel, dummy, true) == MOD_RES_DENY)
return MOD_RES_DENY;
- if (mh->GetLevelRequired() > mylevel)
+ if (mh->GetLevelRequired(true) > mylevel)
{
source->WriteNumeric(ERR_CHANOPRIVSNEEDED, channel->name, InspIRCd::Format("You must be able to set mode '%s' to include it in an autoop", mid.c_str()));
return MOD_RES_DENY;
diff --git a/src/modules/m_customprefix.cpp b/src/modules/m_customprefix.cpp
index f6f9a84f6..1be9676b5 100644
--- a/src/modules/m_customprefix.cpp
+++ b/src/modules/m_customprefix.cpp
@@ -33,7 +33,8 @@ class CustomPrefixMode : public PrefixMode
prefix = v.c_str()[0];
v = tag->getString("letter");
mode = v.c_str()[0];
- levelrequired = tag->getInt("ranktoset", prefixrank);
+ ranktoset = tag->getInt("ranktoset", prefixrank, prefixrank, UINT_MAX);
+ ranktounset = tag->getInt("ranktounset", ranktoset, ranktoset, UINT_MAX);
depriv = tag->getBool("depriv", true);
}
diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp
index e864a8289..6d1251345 100644
--- a/src/modules/m_delayjoin.cpp
+++ b/src/modules/m_delayjoin.cpp
@@ -28,7 +28,7 @@ class DelayJoinMode : public ModeHandler
public:
DelayJoinMode(Module* Parent) : ModeHandler(Parent, "delayjoin", 'D', PARAM_NONE, MODETYPE_CHANNEL)
{
- levelrequired = OP_VALUE;
+ ranktoset = ranktounset = OP_VALUE;
}
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
diff --git a/src/modules/m_delaymsg.cpp b/src/modules/m_delaymsg.cpp
index 1ad41cc57..3471c7fd2 100644
--- a/src/modules/m_delaymsg.cpp
+++ b/src/modules/m_delaymsg.cpp
@@ -27,7 +27,7 @@ class DelayMsgMode : public ParamMode<DelayMsgMode, LocalIntExt>
: ParamMode<DelayMsgMode, LocalIntExt>(Parent, "delaymsg", 'd')
, jointime("delaymsg", ExtensionItem::EXT_MEMBERSHIP, Parent)
{
- levelrequired = OP_VALUE;
+ ranktoset = ranktounset = OP_VALUE;
}
bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel*)
diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp
index 76e66bdc2..a96e47bc6 100644
--- a/src/modules/m_ojoin.cpp
+++ b/src/modules/m_ojoin.cpp
@@ -89,7 +89,7 @@ class NetworkPrefix : public PrefixMode
NetworkPrefix(Module* parent, char NPrefix)
: PrefixMode(parent, "official-join", 'Y', NETWORK_VALUE, NPrefix)
{
- levelrequired = INT_MAX;
+ ranktoset = ranktounset = UINT_MAX;
}
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 73155b394..8b68dbe60 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -33,7 +33,7 @@ class OperPrefixMode : public PrefixMode
: PrefixMode(Creator, "operprefix", 'y', OPERPREFIX_VALUE)
{
prefix = ServerInstance->Config->ConfValue("operprefix")->getString("prefix", "!", 1, 1)[0];
- levelrequired = INT_MAX;
+ ranktoset = ranktounset = UINT_MAX;
}
};
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index fd09dd6ec..2094d3c96 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -42,7 +42,7 @@ class ModuleOverride : public Module
for (Modes::ChangeList::List::const_iterator i = list.begin(); i != list.end(); ++i)
{
ModeHandler* mh = i->mh;
- if (mh->GetLevelRequired() > userlevel)
+ if (mh->GetLevelRequired(i->adding) > userlevel)
return true;
}
return false;
diff --git a/src/modules/m_rmode.cpp b/src/modules/m_rmode.cpp
index 37c6e62ff..7c15247be 100644
--- a/src/modules/m_rmode.cpp
+++ b/src/modules/m_rmode.cpp
@@ -50,7 +50,7 @@ class CommandRMode : public Command
return CMD_FAILURE;
}
- if (chan->GetPrefixValue(user) < mh->GetLevelRequired())
+ if (chan->GetPrefixValue(user) < mh->GetLevelRequired(false))
{
user->WriteNotice("You do not have access to unset " + ConvToStr(modeletter) + " on " + chan->name + ".");
return CMD_FAILURE;