]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/svsjoin.cpp
Allow Channel::WriteNotice send to other servers and status ranks.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / svsjoin.cpp
index 032633416851e0dd4a5a71d0f84911985ce4cbcd..92187ddf76297a85681cfd23146be4a26b0a0d10 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "commands.h"
 
-CmdResult CommandSVSJoin::Handle(const std::vector<std::string>& parameters, User *user)
+CmdResult CommandSVSJoin::Handle(User* user, Params& parameters)
 {
        // Check for valid channel name
        if (!ServerInstance->IsChannel(parameters[1]))
@@ -36,14 +36,23 @@ CmdResult CommandSVSJoin::Handle(const std::vector<std::string>& parameters, Use
        /* 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;
 }
 
-RouteDescriptor CommandSVSJoin::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor CommandSVSJoin::GetRouting(User* user, const Params& parameters)
 {
-       User* u = ServerInstance->FindUUID(parameters[0]);
-       if (u)
-               return ROUTE_OPT_UCAST(u->server);
-       return ROUTE_LOCALONLY;
+       return ROUTE_OPT_UCAST(parameters[0]);
 }