]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cban.cpp
Should now work with ports bound to all interfaces
[user/henk/code/inspircd.git] / src / modules / m_cban.cpp
index 9c196a9bb73a0392b98404d68346cbf29ccf0972..60884331e64031c0ce106bebd232a56f208f659a 100644 (file)
@@ -47,14 +47,14 @@ cbanlist cbans;
 class CommandCban : public Command
 {
  public:
-       CommandCban(InspIRCd* Me) : Command(Me, "CBAN", 'o', 1)
+       CommandCban(InspIRCd* Me) : Command(Me, "CBAN", "o", 1)
        {
                this->source = "m_cban.so";
                this->syntax = "<channel> [<duration> :<reason>]";
                TRANSLATE4(TR_TEXT,TR_TEXT,TR_TEXT,TR_END);
        }
 
-       CmdResult Handle(const char** parameters, int pcnt, User *user)
+       CmdResult Handle(const char* const* parameters, int pcnt, User *user)
        {
                /* syntax: CBAN #channel time :reason goes here */
                /* 'time' is a human-readable timestring, like 2d3h2s. */
@@ -67,7 +67,7 @@ class CommandCban : public Command
                                if (parameters[0] == iter->chname)
                                {
                                        long remaining = iter->length + ServerInstance->Time();
-                                       user->WriteServ("386 %s %s :Removed CBAN due to expire at %s (%s)", user->nick, iter->chname.c_str(), ServerInstance->TimeString(remaining).c_str(), iter->reason.c_str());
+                                       user->WriteNumeric(386, "%s %s :Removed CBAN due to expire at %s (%s)", user->nick, iter->chname.c_str(), ServerInstance->TimeString(remaining).c_str(), iter->reason.c_str());
                                        cbans.erase(iter);
                                        break;
                                }
@@ -90,18 +90,18 @@ class CommandCban : public Command
                                
                                if(length > 0)
                                {
-                                       user->WriteServ("385 %s %s :Added %lu second channel ban (%s)", user->nick, parameters[0], length, reason.c_str());
+                                       user->WriteNumeric(385, "%s %s :Added %lu second channel ban (%s)", user->nick, parameters[0], length, reason.c_str());
                                        ServerInstance->SNO->WriteToSnoMask('A', "%s added %lu second channel ban on %s (%s)", user->nick, length, parameters[0], reason.c_str());
                                }
                                else
                                {
-                                       user->WriteServ("385 %s %s :Added permanent channel ban (%s)", user->nick, parameters[0], reason.c_str());
+                                       user->WriteNumeric(385, "%s %s :Added permanent channel ban (%s)", user->nick, parameters[0], reason.c_str());
                                        ServerInstance->SNO->WriteToSnoMask('A', "%s added permanent channel ban on %s (%s)", user->nick, parameters[0], reason.c_str());
                                }
                        }
                        else
                        {
-                               user->WriteServ("403 %s %s :Invalid channel name", user->nick, parameters[0]);
+                               user->WriteNumeric(403, "%s %s :Invalid channel name", user->nick, parameters[0]);
                                return CMD_FAILURE;
                        }
                }
@@ -189,7 +189,7 @@ class ModuleCBan : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1, 1, 0, 1, VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version(1, 2, 0, 1, VF_COMMON | VF_VENDOR, API_VERSION);
        }
 
        std::string EncodeCBan(const CBan &ban)