summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-09-02 19:26:51 +0200
committerAttila Molnar <attilamolnar@hush.com>2016-09-02 19:26:51 +0200
commitf673caf8a89c4d9b8b631e46d20c71118a29eb9c (patch)
tree43ba4659130ef235e19d23d728c1b3c181b9dfb9 /src/modules
parenteef45dbfb90f951f3048038aea3ff68b5c157f6d (diff)
m_spanningtree Add workaround to make SVS* commands work when using ENCAP
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/encap.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/encap.cpp b/src/modules/m_spanningtree/encap.cpp
index 95f8f4e4a..8059d2a39 100644
--- a/src/modules/m_spanningtree/encap.cpp
+++ b/src/modules/m_spanningtree/encap.cpp
@@ -20,6 +20,7 @@
#include "inspircd.h"
#include "commands.h"
+#include "main.h"
/** ENCAP */
CmdResult CommandEncap::Handle(User* user, std::vector<std::string>& params)
@@ -27,6 +28,16 @@ CmdResult CommandEncap::Handle(User* user, std::vector<std::string>& params)
if (ServerInstance->Config->GetSID() == params[0] || InspIRCd::Match(ServerInstance->Config->ServerName, params[0]))
{
parameterlist plist(params.begin() + 2, params.end());
+
+ // XXX: Workaround for SVS* commands provided by spanningtree not being registered in the core
+ if ((params[1] == "SVSNICK") || (params[1] == "SVSJOIN") || (params[1] == "SVSPART"))
+ {
+ ServerCommand* const scmd = Utils->Creator->CmdManager.GetHandler(params[1]);
+ if (scmd)
+ scmd->Handle(user, plist);
+ return CMD_SUCCESS;
+ }
+
Command* cmd = NULL;
ServerInstance->Parser.CallHandler(params[1], plist, user, &cmd);
// Discard return value, ENCAP shall succeed even if the command does not exist