X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_remove.cpp;h=5872b59788fbbe421980b8e7307012cbfa771e87;hb=806e57433a38193ae14942ee60f573fe47f4b643;hp=30924eb2f1e4674c515703fa5209d909c3684f18;hpb=8f5efbc7aa33b792e02d01e3288f553e6e98ccaa;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index 30924eb2f..5872b5978 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -76,19 +76,19 @@ 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; } if (!channel->HasUser(target)) { - user->WriteServ( "NOTICE %s :*** The user %s is not on channel %s", user->nick.c_str(), target->nick.c_str(), channel->name.c_str()); + user->WriteNotice(InspIRCd::Format("*** The user %s is not on channel %s", target->nick.c_str(), channel->name.c_str())); return CMD_FAILURE; } 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,21 +130,21 @@ 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); } else { - user->WriteServ( "NOTICE %s :*** You do not have access to /remove %s from %s", user->nick.c_str(), target->nick.c_str(), channel->name.c_str()); + user->WriteNotice(InspIRCd::Format("*** You do not have access to /remove %s from %s", target->nick.c_str(), channel->name.c_str())); return CMD_FAILURE; } } 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; }