X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_remove.cpp;h=dfe6247020cef4ed716e6a511e75346a244011fb;hb=4aa27e75af8da0a5bc2e35f931f0165339f5f289;hp=8d0009d71330baca2816c421a412c102d7cbbadf;hpb=7bc9c25b8b9a04cb85fa0c00f304fe489ad9148d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index 8d0009d71..dfe624702 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -76,7 +76,7 @@ class RemoveBase : public Command /* Fix by brain - someone needs to learn to validate their input! */ if ((!target) || (target->registered != REG_ALL) || (!channel)) { - user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", !channel ? channame.c_str() : username.c_str()); + user->WriteNumeric(Numerics::NoSuchNick(channel ? username.c_str() : channame.c_str())); return CMD_FAILURE; } @@ -88,7 +88,7 @@ class RemoveBase : public Command if (target->server->IsULine()) { - user->WriteNumeric(482, "%s :Only a u-line may remove a u-line from a channel.", channame.c_str()); + user->WriteNumeric(482, channame, "Only a u-line may remove a u-line from a channel."); return CMD_FAILURE; } @@ -108,7 +108,7 @@ class RemoveBase : public Command if (!IS_LOCAL(target)) { // Send an ENCAP REMOVE with parameters being in the old 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 p; p.push_back(target->uuid); p.push_back(channel->name); @@ -130,7 +130,7 @@ class RemoveBase : public Command /* 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); @@ -144,7 +144,7 @@ class RemoveBase : public Command else { /* m_nokicks.so was loaded and +Q was set, block! */ - user->WriteNumeric(ERR_RESTRICTED, "%s :Can't remove user %s from channel (nokicks mode is set)", channel->name.c_str(), target->nick.c_str()); + user->WriteNumeric(ERR_RESTRICTED, channel->name, InspIRCd::Format("Can't remove user %s from channel (nokicks mode is set)", target->nick.c_str())); return CMD_FAILURE; } @@ -164,7 +164,7 @@ class CommandRemove : public RemoveBase TRANSLATE3(TR_NICK, TR_TEXT, TR_TEXT); } - CmdResult Handle (const std::vector& parameters, User *user) + CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE { return HandleRMB(parameters, user, false); } @@ -182,7 +182,7 @@ class CommandFpart : public RemoveBase TRANSLATE3(TR_TEXT, TR_NICK, TR_TEXT); } - CmdResult Handle (const std::vector& parameters, User *user) + CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE { return HandleRMB(parameters, user, true); }