summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/svsjoin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree/svsjoin.cpp')
-rw-r--r--src/modules/m_spanningtree/svsjoin.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/modules/m_spanningtree/svsjoin.cpp b/src/modules/m_spanningtree/svsjoin.cpp
index d8df6fb95..cd7c7e06d 100644
--- a/src/modules/m_spanningtree/svsjoin.cpp
+++ b/src/modules/m_spanningtree/svsjoin.cpp
@@ -19,29 +19,29 @@
#include "main.h"
#include "utils.h"
#include "treeserver.h"
-#include "treesocket.h"
+#include "commands.h"
-/* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
-
-bool TreeSocket::ServiceJoin(const std::string &prefix, parameterlist &params)
+CmdResult CommandSVSJoin::Handle(const std::vector<std::string>& parameters, User *user)
{
- // 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;
+ if (!ServerInstance->IsChannel(parameters[1].c_str(), ServerInstance->Config->Limits.ChanMax))
+ return CMD_FAILURE;
// Check target exists
- User* u = ServerInstance->FindNick(params[0]);
+ User* u = ServerInstance->FindNick(parameters[0]);
if (!u)
- return true;
+ return CMD_FAILURE;
/* 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;
+ Channel::JoinUser(u, parameters[1].c_str(), false, "", false, ServerInstance->Time());
+ return CMD_SUCCESS;
}
+RouteDescriptor CommandSVSJoin::GetRouting(User* user, const std::vector<std::string>& parameters)
+{
+ User* u = ServerInstance->FindNick(parameters[0]);
+ if (u)
+ return ROUTE_OPT_UCAST(u->server);
+ return ROUTE_LOCALONLY;
+}