summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands/cmd_invite.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/commands/cmd_invite.cpp b/src/commands/cmd_invite.cpp
index 8025296ae..e12b8244f 100644
--- a/src/commands/cmd_invite.cpp
+++ b/src/commands/cmd_invite.cpp
@@ -94,11 +94,13 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use
{
if (IS_LOCAL(user))
{
- int rank = c->GetPrefixValue(user);
+ unsigned int rank = c->GetPrefixValue(user);
if (rank < HALFOP_VALUE)
{
+ // Check whether halfop mode is available and phrase error message accordingly
+ ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL);
user->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :You must be a channel %soperator",
- user->nick.c_str(), c->name.c_str(), rank >= HALFOP_VALUE ? "" : "half-");
+ user->nick.c_str(), c->name.c_str(), (mh && mh->name == "halfop" ? "half-" : ""));
return CMD_FAILURE;
}
}