]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_close.cpp
Fix crash if OnCheckBan is called and there is no list, the if was reversed.
[user/henk/code/inspircd.git] / src / modules / m_close.cpp
index 5d703c0d0221e7e559416e5ef2ade32018e8c4bd..fb4b0368286d5a109720f331369a4dbd61b463ce 100644 (file)
@@ -19,20 +19,20 @@ class CommandClose : public Command
 {
  public:
        /* Command 'close', needs operator */
-       CommandClose (InspIRCd* Instance) : Command(Instance,"CLOSE", 'o', 0)
+       CommandClose (InspIRCd* Instance) : Command(Instance,"CLOSE", "o", 0)
        {
                this->source = "m_close.so";
        }
 
-       CmdResult Handle (const char** parameters, int pcnt, User *user)
+       CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
                std::map<std::string,int> closed;
 
-               for (std::vector<User*>::iterator u = ServerInstance->local_users.begin(); u != ServerInstance->local_users.end(); u++)
+               for (std::vector<User*>::iterator u = ServerInstance->Users->local_users.begin(); u != ServerInstance->Users->local_users.end(); u++)
                {
                        if ((*u)->registered != REG_ALL)
                        {
-                               User::QuitUser(ServerInstance, *u, "Closing all unknown connections per request");
+                               ServerInstance->Users->QuitUser(*u, "Closing all unknown connections per request");
                                std::string key = ConvToStr((*u)->GetIPString())+"."+ConvToStr((*u)->GetPort());
                                closed[key]++;
                        }
@@ -72,7 +72,7 @@ class ModuleClose : 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);
        }
 };