From f673caf8a89c4d9b8b631e46d20c71118a29eb9c Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Fri, 2 Sep 2016 19:26:51 +0200 Subject: m_spanningtree Add workaround to make SVS* commands work when using ENCAP --- src/modules/m_spanningtree/encap.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/modules/m_spanningtree') 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& params) @@ -27,6 +28,16 @@ CmdResult CommandEncap::Handle(User* user, std::vector& 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 -- cgit v1.2.3