X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_close.cpp;h=3f0eedaafcfb9e961ddf779422b37ee75fc306e5;hb=761e6d75ba37b984998952940ed681e79e456142;hp=806a88640fcae54af7d566b95baa2295629decb8;hpb=54d10d53c730ab81ca6464fe2f0e0ecbcd435672;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp index 806a88640..3f0eedaaf 100644 --- a/src/modules/m_close.cpp +++ b/src/modules/m_close.cpp @@ -28,15 +28,19 @@ class CommandClose : public Command /* Command 'close', needs operator */ CommandClose(Module* Creator) : Command(Creator,"CLOSE", 0) { - flags_needed = 'o'; } + flags_needed = 'o'; + } CmdResult Handle (const std::vector ¶meters, User *src) { std::map closed; - for (LocalUserList::const_iterator u = ServerInstance->Users->local_users.begin(); u != ServerInstance->Users->local_users.end(); ++u) + const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers(); + for (UserManager::LocalList::const_iterator u = list.begin(); u != list.end(); ) { + // Quitting the user removes it from the list LocalUser* user = *u; + ++u; if (user->registered != REG_ALL) { ServerInstance->Users->QuitUser(user, "Closing all unknown connections per request"); @@ -70,11 +74,6 @@ class ModuleClose : public Module { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(cmd); - } - Version GetVersion() CXX11_OVERRIDE { return Version("Provides /CLOSE functionality", VF_VENDOR);