summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/svsjoin.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/modules/m_spanningtree/svsjoin.cpp b/src/modules/m_spanningtree/svsjoin.cpp
index 4fdc05dea..d8df6fb95 100644
--- a/src/modules/m_spanningtree/svsjoin.cpp
+++ b/src/modules/m_spanningtree/svsjoin.cpp
@@ -25,18 +25,23 @@
bool TreeSocket::ServiceJoin(const std::string &prefix, parameterlist &params)
{
+ // Check params
if (params.size() < 2)
return true;
+ // Check for valid channel name
+ if (!ServerInstance->IsChannel(params[1].c_str(), ServerInstance->Config->Limits.ChanMax))
+ return true;
+
+ // Check target exists
User* u = ServerInstance->FindNick(params[0]);
+ if (!u)
+ return true;
- if (u)
- {
- /* only join if it's local, otherwise just pass it on! */
- if (IS_LOCAL(u))
- Channel::JoinUser(u, params[1].c_str(), false, "", false, ServerInstance->Time());
- Utils->DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
- }
+ /* only join if it's local, otherwise just pass it on! */
+ if (IS_LOCAL(u))
+ Channel::JoinUser(u, params[1].c_str(), false, "", false, ServerInstance->Time());
+ Utils->DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
return true;
}