X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cloaking.cpp;h=daa04cf9bd2a6a4da5d77cfd2bf3cc6dc41e3322;hb=80e81e3b81b779901fd9d67f8ae030ee30c0bcec;hp=3f1774e7b88e1c7704893e2b5c5ac3447c6a8ec1;hpb=e73d011e68c577df72c2f0eae235c32cd4261870;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 3f1774e7b..daa04cf9b 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2017-2019 B00mX0r + * Copyright (C) 2017, 2019 B00mX0r * Copyright (C) 2017 Sheogorath * Copyright (C) 2016 Adam * Copyright (C) 2014 Thomas Fargeix @@ -11,9 +11,10 @@ * Copyright (C) 2011 jackmcbarn * Copyright (C) 2009-2010 Daniel De Graaf * Copyright (C) 2007-2009 Robin Burchell - * Copyright (C) 2007-2008, 2010 Craig Edwards * Copyright (C) 2007-2008 Dennis Friis + * Copyright (C) 2007 John Brooks * Copyright (C) 2006 Oliver Lupton + * Copyright (C) 2003, 2007-2008, 2010 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -80,13 +81,25 @@ struct CloakInfo typedef std::vector CloakList; -/** Handles user mode +x - */ +class CloakExtItem : public SimpleExtItem +{ + public: + CloakExtItem(Module* Creator) + : SimpleExtItem("cloaks", ExtensionItem::EXT_USER, Creator) + { + } + + std::string ToHuman(const Extensible* container, void* item) const CXX11_OVERRIDE + { + return stdalgo::string::join(*static_cast(item), ' '); + } +}; + class CloakUser : public ModeHandler { public: bool active; - SimpleExtItem ext; + CloakExtItem ext; std::string debounce_uid; time_t debounce_ts; int debounce_count; @@ -94,7 +107,7 @@ class CloakUser : public ModeHandler CloakUser(Module* source) : ModeHandler(source, "cloak", 'x', PARAM_NONE, MODETYPE_USER) , active(false) - , ext("cloaked_host", ExtensionItem::EXT_USER, source) + , ext(source) , debounce_ts(0) , debounce_count(0) { @@ -493,7 +506,7 @@ class ModuleCloaking : public Module void OnSetUserIP(LocalUser* user) CXX11_OVERRIDE { // Connecting users are handled in OnUserConnect not here. - if (user->registered != REG_ALL) + if (user->registered != REG_ALL || user->quitting) return; // Remove the cloaks and generate new ones.