]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cap.cpp
Send SVSNICKs during nick collision to prevent servers that do not fully implement...
[user/henk/code/inspircd.git] / src / modules / m_cap.cpp
index f69df02be7d95ca18fb89e13d5a6c4d711fc7750..b8abd1b02116d0d5a2e2307ec772ac7953bd460b 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
 CAP LS
 :alfred.staticbox.net CAP * LS :multi-prefix sasl
 CAP REQ :multi-prefix
-:alfred.staticbox.net CAP * ACK :multi-prefix 
+:alfred.staticbox.net CAP * ACK :multi-prefix
 CAP CLEAR
 :alfred.staticbox.net CAP * ACK :-multi-prefix
 CAP REQ :multi-prefix
-:alfred.staticbox.net CAP * ACK :multi-prefix 
+:alfred.staticbox.net CAP * ACK :multi-prefix
 CAP LIST
 :alfred.staticbox.net CAP * LIST :multi-prefix
 CAP END
@@ -41,9 +41,9 @@ class CommandCAP : public Command
                this->source = "m_cap.so";
        }
 
-       CmdResult Handle (const char* const* parameters, int pcnt, User *user)
+       CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
-               irc::string subcommand = parameters[0];
+               irc::string subcommand = parameters[0].c_str();
 
                if (subcommand == "REQ")
                {
@@ -53,7 +53,7 @@ class CommandCAP : public Command
                        Data.user = user;
                        Data.creator = this->Creator;
 
-                       if (pcnt < 2)
+                       if (parameters.size() < 2)
                                return CMD_FAILURE;
 
                        // tokenize the input into a nice list of requested caps
@@ -76,9 +76,9 @@ class CommandCAP : public Command
                                user->WriteServ("CAP * ACK :%s", AckResult.c_str());
                        }
 
-                       if (Data.nak.size() > 0)
+                       if (Data.wanted.size() > 0)
                        {
-                               std::string NakResult = irc::stringjoiner(" ", Data.nak, 0, Data.nak.size() - 1).GetJoined();
+                               std::string NakResult = irc::stringjoiner(" ", Data.wanted, 0, Data.wanted.size() - 1).GetJoined();
                                user->WriteServ("CAP * NAK :%s", NakResult.c_str());
                        }
                }
@@ -123,7 +123,7 @@ class CommandCAP : public Command
                }
                else
                {
-                       user->WriteServ("410 * %s :Invalid CAP subcommand", subcommand.c_str());
+                       user->WriteNumeric(ERR_INVALIDCAPSUBCOMMAND, "* %s :Invalid CAP subcommand", subcommand.c_str());
                }
 
                return CMD_FAILURE;
@@ -160,7 +160,7 @@ class ModuleCAP : public Module
 
        virtual Version GetVersion()
        {
-               return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
+               return Version("$Id$", VF_VENDOR, API_VERSION);
        }
 };