]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cap.cpp
Add support for blacklists and whitelists, just http password auth to go (the most...
[user/henk/code/inspircd.git] / src / modules / m_cap.cpp
index f69df02be7d95ca18fb89e13d5a6c4d711fc7750..986e40713c074b640e2e6cf55d5b6a2a34b24f62 100644 (file)
@@ -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(410, "* %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(1, 2, 0, 0, VF_VENDOR, API_VERSION);
        }
 };