summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-09 17:40:22 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-09 17:40:22 +0200
commitf5079e6b2ab7551517132978185191154b92dacb (patch)
tree18985c675dfbe0e82d1df3a6221d02a6573617cd /src
parent4a77f472fd5bad95f1e4e26835317533d988ea15 (diff)
m_remove Manually forward all REMOVE messages, turn FPART into REMOVE
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_remove.cpp30
1 files changed, 12 insertions, 18 deletions
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 <user> <chan> order which is
+ // compatible with both 2.0 and 2.2. This also turns FPART into REMOVE.
+ std::vector<std::string> 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<std::string>& parameters) = 0;
};
/** Handle /REMOVE
@@ -154,14 +164,6 @@ class CommandRemove : public RemoveBase
{
return HandleRMB(parameters, user, false);
}
-
- RouteDescriptor GetRouting(User* user, const std::vector<std::string>& 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<std::string>& parameters)
- {
- User* dest = ServerInstance->FindNick(parameters[1]);
- if (dest)
- return ROUTE_OPT_UCAST(dest->server);
- return ROUTE_LOCALONLY;
- }
};
class ModuleRemove : public Module