diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-02-11 17:47:51 +0100 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-02-11 17:47:51 +0100 |
commit | 1f541d7bbce6f2a254b3ba46ed9a31da593674de (patch) | |
tree | 568cb71547a8e2d3b58e1a89feb59eeac7fc1298 /src | |
parent | 58212b3d2b7197fa7e89de4c97848cdc937b32c3 (diff) |
cmd_invite Correct error message when the user has no privs to invite and no halfop prefix is available
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/cmd_invite.cpp | 6 |
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; } } |