channel = ServerInstance->FindChan(channame);
/* Fix by brain - someone needs to learn to validate their input! */
- if ((!target) || (target->registered != REG_ALL) || (!channel))
+ if (!channel)
{
- user->WriteNumeric(Numerics::NoSuchNick(channel ? username.c_str() : channame.c_str()));
+ user->WriteNumeric(Numerics::NoSuchChannel(channame));
+ return CMD_FAILURE;
+ }
+ if ((!target) || (target->registered != REG_ALL))
+ {
+ user->WriteNumeric(Numerics::NoSuchNick(username));
return CMD_FAILURE;
}
if (!IS_LOCAL(target))
{
// Send an ENCAP REMOVE with parameters being in the old <user> <chan> order which is
- // compatible with both 2.0 and 2.2. This also turns FPART into REMOVE.
+ // compatible with both 2.0 and 3.0. This also turns FPART into REMOVE.
std::vector<std::string> p;
p.push_back(target->uuid);
p.push_back(channel->name);
/* Build up the part reason string. */
reason = "Removed by " + user->nick + ": " + reasonparam;
- channel->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s removed %s from the channel", channel->name.c_str(), user->nick.c_str(), target->nick.c_str());
+ channel->WriteNotice(InspIRCd::Format("%s removed %s from the channel", user->nick.c_str(), target->nick.c_str()));
target->WriteNotice("*** " + user->nick + " removed you from " + channel->name + " with the message: " + reasonparam);
channel->PartUser(target, reason);
TRANSLATE3(TR_NICK, TR_TEXT, TR_TEXT);
}
- CmdResult Handle (const std::vector<std::string>& parameters, User *user)
+ CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
{
return HandleRMB(parameters, user, false);
}
TRANSLATE3(TR_TEXT, TR_NICK, TR_TEXT);
}
- CmdResult Handle (const std::vector<std::string>& parameters, User *user)
+ CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
{
return HandleRMB(parameters, user, true);
}