diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-04-01 16:32:01 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-04-01 16:32:01 +0200 |
commit | 157d9445f53ff63cfabf19d5f16ebdf84e6e0454 (patch) | |
tree | bfae7d8371901e4546752046c0a7965aac15d432 /src/commands | |
parent | 8de053ee389e9c66d4a9270083e8d965c309e107 (diff) |
cmd_invite Check if the inviting user is on the channel before potentially telling him the target is already on it
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_invite.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/commands/cmd_invite.cpp b/src/commands/cmd_invite.cpp index fd595d618..c69e6bd1b 100644 --- a/src/commands/cmd_invite.cpp +++ b/src/commands/cmd_invite.cpp @@ -72,16 +72,16 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use return CMD_FAILURE; } - if (c->HasUser(u)) - { - user->WriteNumeric(ERR_USERONCHANNEL, "%s %s %s :is already on channel",user->nick.c_str(),u->nick.c_str(),c->name.c_str()); - return CMD_FAILURE; - } - if ((IS_LOCAL(user)) && (!c->HasUser(user))) - { + { user->WriteNumeric(ERR_NOTONCHANNEL, "%s %s :You're not on that channel!",user->nick.c_str(), c->name.c_str()); - return CMD_FAILURE; + return CMD_FAILURE; + } + + if (c->HasUser(u)) + { + user->WriteNumeric(ERR_USERONCHANNEL, "%s %s %s :is already on channel",user->nick.c_str(),u->nick.c_str(),c->name.c_str()); + return CMD_FAILURE; } FIRST_MOD_RESULT(OnUserPreInvite, MOD_RESULT, (user,u,c,timeout)); |