]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_join.cpp
Fix MySQL crash on module unload with empty query queue
[user/henk/code/inspircd.git] / src / commands / cmd_join.cpp
index d86516aaa6afba568758d7ac247669d03e17d860..17a71688a809ec8ac80108bdeafc89b76a7f1f73 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -31,7 +31,7 @@ class CommandJoin : public Command
  public:
        /** Constructor for join.
         */
-       CommandJoin (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"JOIN", 0, 1, false, 2) { syntax = "<channel>{,<channel>} {<key>{,<key>}}"; }
+       CommandJoin ( Module* parent) : Command(parent,"JOIN", 1, 2) { syntax = "<channel>{,<channel>} {<key>{,<key>}}"; Penalty = 2; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
@@ -50,23 +50,23 @@ CmdResult CommandJoin::Handle (const std::vector<std::string>& parameters, User
 {
        if (parameters.size() > 1)
        {
-               if (ServerInstance->Parser->LoopCall(user, this, parameters, 0, 1))
+               if (ServerInstance->Parser->LoopCall(user, this, parameters, 0, 1, false))
                        return CMD_SUCCESS;
 
                if (ServerInstance->IsChannel(parameters[0].c_str(), ServerInstance->Config->Limits.ChanMax))
                {
-                       Channel::JoinUser(ServerInstance, user, parameters[0].c_str(), false, parameters[1].c_str(), false);
+                       Channel::JoinUser(user, parameters[0].c_str(), false, parameters[1].c_str(), false);
                        return CMD_SUCCESS;
                }
        }
        else
        {
-               if (ServerInstance->Parser->LoopCall(user, this, parameters, 0))
+               if (ServerInstance->Parser->LoopCall(user, this, parameters, 0, -1, false))
                        return CMD_SUCCESS;
 
                if (ServerInstance->IsChannel(parameters[0].c_str(), ServerInstance->Config->Limits.ChanMax))
                {
-                       Channel::JoinUser(ServerInstance, user, parameters[0].c_str(), false, "", false);
+                       Channel::JoinUser(user, parameters[0].c_str(), false, "", false);
                        return CMD_SUCCESS;
                }
        }