diff options
Diffstat (limited to 'include/modules/cap.h')
-rw-r--r-- | include/modules/cap.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/modules/cap.h b/include/modules/cap.h index cc1cb8d8c..fae7fff15 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -40,11 +40,14 @@ class CapEvent : public Event class GenericCap { + bool active; + public: LocalIntExt ext; const std::string cap; GenericCap(Module* parent, const std::string& Cap) - : ext("cap_" + Cap, ExtensionItem::EXT_USER, parent) + : active(true) + , ext("cap_" + Cap, ExtensionItem::EXT_USER, parent) , cap(Cap) { } @@ -54,6 +57,9 @@ class GenericCap if (ev.id != "cap_request") return; + if (!active) + return; + CapEvent *data = static_cast<CapEvent*>(&ev); if (data->type == CapEvent::CAPEVENT_REQ) { @@ -87,4 +93,7 @@ class GenericCap ext.set(data->user, 0); } } + + void SetActive(bool newstate) { active = newstate; } + bool IsActive() const { return active; } }; |