]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sajoin.cpp
Add User::WriteRemoteNotice()
[user/henk/code/inspircd.git] / src / modules / m_sajoin.cpp
index e3008469016f42aa003dd5813458787b505c6d89..9696b08a1aaea186623b55afdbe894dd9442d89a 100644 (file)
@@ -29,13 +29,17 @@ class CommandSajoin : public Command
        CommandSajoin(Module* Creator) : Command(Creator,"SAJOIN", 1)
        {
                allow_empty_last_param = false;
-               flags_needed = 'o'; Penalty = 0; syntax = "[<nick>] <channel>";
+               flags_needed = 'o'; Penalty = 0; syntax = "[<nick>] <channel>[,<channel>]";
                TRANSLATE2(TR_NICK, TR_TEXT);
        }
 
        CmdResult Handle (const std::vector<std::string>& parameters, User *user)
        {
-               const std::string& channel = parameters.size() > 1 ? parameters[1] : parameters[0];
+               const unsigned int channelindex = (parameters.size() > 1) ? 1 : 0;
+               if (CommandParser::LoopCall(user, this, parameters, channelindex))
+                       return CMD_FAILURE;
+
+               const std::string& channel = parameters[channelindex];
                const std::string& nickname = parameters.size() > 1 ? parameters[0] : user->nick;
 
                User* dest = ServerInstance->FindNick(nickname);
@@ -49,7 +53,7 @@ class CommandSajoin : public Command
 
                        if (dest->server->IsULine())
                        {
-                               user->WriteNumeric(ERR_NOPRIVILEGES, ":Cannot use an SA command on a u-lined client");
+                               user->WriteNumeric(ERR_NOPRIVILEGES, "Cannot use an SA command on a u-lined client");
                                return CMD_FAILURE;
                        }
                        if (IS_LOCAL(user) && !ServerInstance->IsChannel(channel))