summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-09-01 15:17:23 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-09-01 15:17:23 +0200
commit5f05a6b916d84ef620fbc750c3346bf50eafd69a (patch)
treec532304bebcad0513e5b19a69050fed9b7cfc436
parent84cfcdaf9ead83c5531722ec8742728ac39121db (diff)
m_spanningtree Add optional key parameter to SVSJOIN and allow it to do override joins
Slightly more readable version of #892 by @ShutterQuick
-rw-r--r--src/modules/m_spanningtree/svsjoin.cpp14
1 files changed, 13 insertions, 1 deletions
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<std::string>& 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;
}