]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_invisible.cpp
Fixes to make this module scale much better. Dont connect on each query, keep open...
[user/henk/code/inspircd.git] / src / modules / m_invisible.cpp
index de573dfde42c8d8282b957eb36f13111dfbe4496..155c518c4a2804bf845349e991987b08eb3bfbd9 100644 (file)
@@ -141,8 +141,8 @@ class InvisibleDeOper : public ModeWatcher
                if ((!adding) && (dest->IsModeSet('Q')))
                {
                        std::vector<std::string> newmodes;
-                       newmodes[0] = dest->nick;
-                       newmodes[1] = "-Q";
+                       newmodes.push_back(dest->nick);
+                       newmodes.push_back("-Q");
                        ServerInstance->Modes->Process(newmodes, source, true);
                }
                return true;
@@ -223,7 +223,6 @@ class ModuleInvisible : public Module
                {
                        Command* parthandler = ServerInstance->Parser->GetHandler("PART");
                        std::vector<std::string> to_leave;
-                       std::vector<std::string> parameters;
                        if (parthandler)
                        {
                                for (UCListIter f = user->chans.begin(); f != user->chans.end(); f++)
@@ -231,7 +230,8 @@ class ModuleInvisible : public Module
                                /* We cant do this neatly in one loop, as we are modifying the map we are iterating */
                                for (std::vector<std::string>::iterator n = to_leave.begin(); n != to_leave.end(); n++)
                                {
-                                       parameters[0] = *n;
+                                       std::vector<std::string> parameters;
+                                       parameters.push_back(*n);
                                        /* This triggers our OnUserPart, above, making the PART silent */
                                        parthandler->Handle(parameters, user);
                                }