diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-09-01 14:58:02 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-09-11 12:11:16 +0200 |
commit | 1f6ba902a6c45d84fcaf534d429ca1084ef35911 (patch) | |
tree | e5ef25abb300a33facd11c98c985abc0987e6ee9 /src | |
parent | 16398df07d4ce1f1d4a2e43d97bc39043f8d44b5 (diff) |
Convert cmd_modenotice into an optional module
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_modenotice.cpp (renamed from src/commands/cmd_modenotice.cpp) | 20 | ||||
-rw-r--r-- | src/modules/m_spanningtree/compat.cpp | 7 |
2 files changed, 25 insertions, 2 deletions
diff --git a/src/commands/cmd_modenotice.cpp b/src/modules/m_modenotice.cpp index 852b72f6a..8998ea8b1 100644 --- a/src/commands/cmd_modenotice.cpp +++ b/src/modules/m_modenotice.cpp @@ -48,8 +48,24 @@ next_user: ; RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { - return ROUTE_BROADCAST; + return ROUTE_OPT_BCAST; } }; -COMMAND_INIT(CommandModeNotice) +class ModuleModeNotice : public Module +{ + CommandModeNotice cmd; + + public: + ModuleModeNotice() + : cmd(this) + { + } + + Version GetVersion() CXX11_OVERRIDE + { + return Version("Provides the /MODENOTICE command", VF_VENDOR); + } +}; + +MODULE_INIT(ModuleModeNotice) diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index 02e11c849..f3d6ac66a 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -286,6 +286,13 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std: params.insert(params.begin()+2, ConvToStr(ServerInstance->Time())); } + else if (cmd == "MODENOTICE") + { + // MODENOTICE is always supported by 2.0 but it's optional in 2.2. + params.insert(params.begin(), "*"); + params.insert(params.begin()+1, cmd); + cmd = "ENCAP"; + } return true; // Passthru } |