diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-03-18 20:31:23 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-03-18 20:31:23 +0000 |
commit | dbcdd42b5b41c8a6c3dbe8081a39eb50008c69e4 (patch) | |
tree | b551caf649ff22da7faaf443641adb4c66515bff /src/modules/m_cap.cpp | |
parent | 83137d5f9274832f152acc7d19de3cb0897f9630 (diff) |
Implement CAP LIST
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9122 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_cap.cpp')
-rw-r--r-- | src/modules/m_cap.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 564ed594b..8a57de0c7 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -14,14 +14,21 @@ #include "inspircd.h" #include "m_cap.h" -/* $ModDesc: Provides a pointless /dalinfo command, demo module */ +/* $ModDesc: Provides the CAP negotiation mechanism seen in ratbox-derived ircds */ /* - * std::string type; - * std::vector<std::string> parameters; - * User* user; - * Module* creator; - */ +CAP LS +:alfred.staticbox.net CAP * LS :multi-prefix sasl +CAP REQ :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 +CAP LIST +:alfred.staticbox.net CAP * LIST :multi-prefix +CAP END +*/ /** Handle /CAP */ @@ -54,16 +61,16 @@ class CommandCAP : public Command { user->Shrink("CAP_REGHOLD"); } - else if (subcommand == "LS") + else if ((subcommand == "LS") || (subcommand == "LIST")) { CapData Data; user->Extend("CAP_REGHOLD"); - Data.type = "LS"; + Data.type = subcommand; Data.user = user; Data.creator = this->Creator; Data.parameter.clear(); - Event event((char*) &Data, (Module*)this->Creator, "cap_ls"); + Event event((char*) &Data, (Module*)this->Creator, subcommand == "LS" ? "cap_ls" : "cap_list"); event.Send(this->ServerInstance); user->WriteServ("CAP * LS :%s", Data.parameter.c_str()); |