aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_cloaking.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-03-10 04:53:30 +0000
committerGravatar Sadie Powell2021-03-10 04:53:30 +0000
commitae997d094597251ec0ec9c5931c97b4db49a31d1 (patch)
tree8bbf2c9346800da792d442ec7f8b6708274e7e06 /src/modules/m_cloaking.cpp
parentMerge branch 'insp3' into master. (diff)
parentRename `<bind:ssl>` to `<bind:sslprofile>`. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_cloaking.cpp')
-rw-r--r--src/modules/m_cloaking.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index 46d2a86de..657f05721 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -81,20 +81,32 @@ struct CloakInfo
typedef std::vector<std::string> CloakList;
-/** Handles user mode +x
- */
+class CloakExtItem : public SimpleExtItem<CloakList>
+{
+ public:
+ CloakExtItem(Module* Creator)
+ : SimpleExtItem(Creator, "cloaks", ExtensionItem::EXT_USER)
+ {
+ }
+
+ std::string ToHuman(const Extensible* container, void* item) const override
+ {
+ return stdalgo::string::join(*static_cast<CloakList*>(item), ' ');
+ }
+};
+
class CloakUser : public ModeHandler
{
public:
bool active = false;
- SimpleExtItem<CloakList> ext;
+ CloakExtItem ext;
std::string debounce_uid;
time_t debounce_ts = 0;
int debounce_count = 0;
CloakUser(Module* source)
: ModeHandler(source, "cloak", 'x', PARAM_NONE, MODETYPE_USER)
- , ext(source, "cloaked_host", ExtensionItem::EXT_USER)
+ , ext(source)
{
}