From ba501ffb59ec5b147bfdcdc89a20b6ed2acaba70 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 9 Mar 2021 10:26:19 +0000 Subject: Add a human-readable version of the cloak list. --- src/modules/m_cloaking.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 1e266908c..b964dedca 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -81,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 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; @@ -95,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) { -- cgit v1.2.3