From 5f05a6b916d84ef620fbc750c3346bf50eafd69a Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 1 Sep 2014 15:17:23 +0200 Subject: m_spanningtree Add optional key parameter to SVSJOIN and allow it to do override joins Slightly more readable version of #892 by @ShutterQuick --- src/modules/m_spanningtree/svsjoin.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/modules/m_spanningtree/svsjoin.cpp b/src/modules/m_spanningtree/svsjoin.cpp index 552e08dd3..98443409a 100644 --- a/src/modules/m_spanningtree/svsjoin.cpp +++ b/src/modules/m_spanningtree/svsjoin.cpp @@ -36,7 +36,19 @@ CmdResult CommandSVSJoin::Handle(User* user, std::vector& parameter /* only join if it's local, otherwise just pass it on! */ LocalUser* localuser = IS_LOCAL(u); if (localuser) - Channel::JoinUser(localuser, parameters[1]); + { + bool override = false; + std::string key; + if (parameters.size() >= 3) + { + key = parameters[2]; + if (key.empty()) + override = true; + } + + Channel::JoinUser(localuser, parameters[1], override, key); + } + return CMD_SUCCESS; } -- cgit v1.2.3