From: Attila Molnar Date: Mon, 9 Jun 2014 15:40:22 +0000 (+0200) Subject: m_remove Manually forward all REMOVE messages, turn FPART into REMOVE X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=f5079e6b2ab7551517132978185191154b92dacb;p=user%2Fhenk%2Fcode%2Finspircd.git m_remove Manually forward all REMOVE messages, turn FPART into REMOVE --- diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index ed9b6ce25..2530f3ef1 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -100,9 +100,20 @@ class RemoveBase : public Command */ if ((!IS_LOCAL(user)) || ((ulevel > VOICE_VALUE) && (ulevel >= tlevel) && (tlevel != 50000))) { - // REMOVE/FPART will be sent to the target's server and it will reply with a PART (or do nothing if it doesn't understand the command) + // REMOVE will be sent to the target's server and it will reply with a PART (or do nothing if it doesn't understand the 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. + std::vector p; + p.push_back(target->uuid); + p.push_back(channel->name); + if (parameters.size() > 2) + p.push_back(":" + parameters[2]); + ServerInstance->PI->SendEncapsulatedData(target->server->GetName(), "REMOVE", p, user); + return CMD_SUCCESS; + } std::string reasonparam; @@ -135,7 +146,6 @@ class RemoveBase : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector& parameters) = 0; }; /** Handle /REMOVE @@ -154,14 +164,6 @@ class CommandRemove : public RemoveBase { return HandleRMB(parameters, user, false); } - - RouteDescriptor GetRouting(User* user, const std::vector& parameters) - { - User* dest = ServerInstance->FindNick(parameters[0]); - if (dest) - return ROUTE_OPT_UCAST(dest->server); - return ROUTE_LOCALONLY; - } }; /** Handle /FPART @@ -180,14 +182,6 @@ class CommandFpart : public RemoveBase { return HandleRMB(parameters, user, true); } - - RouteDescriptor GetRouting(User* user, const std::vector& parameters) - { - User* dest = ServerInstance->FindNick(parameters[1]); - if (dest) - return ROUTE_OPT_UCAST(dest->server); - return ROUTE_LOCALONLY; - } }; class ModuleRemove : public Module