summaryrefslogtreecommitdiff
path: root/src/commands/cmd_invite.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-02-11 17:47:51 +0100
committerattilamolnar <attilamolnar@hush.com>2013-02-11 17:47:51 +0100
commit1f541d7bbce6f2a254b3ba46ed9a31da593674de (patch)
tree568cb71547a8e2d3b58e1a89feb59eeac7fc1298 /src/commands/cmd_invite.cpp
parent58212b3d2b7197fa7e89de4c97848cdc937b32c3 (diff)
cmd_invite Correct error message when the user has no privs to invite and no halfop prefix is available
Diffstat (limited to 'src/commands/cmd_invite.cpp')
-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;
}
}