Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cmd_invite Check if the inviting user is on the channel before potent…

…ially telling him the target is already on it
  • Loading branch information...
commit 157d9445f53ff63cfabf19d5f16ebdf84e6e0454 1 parent 8de053e
@attilamolnar attilamolnar authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/commands/cmd_invite.cpp
View
16 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));
Please sign in to comment.
Something went wrong with that request. Please try again.