summaryrefslogtreecommitdiff
path: root/include/mode.h
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:48:48 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:48:48 +0000
commit24731c63b6320be22f7b3220236271fa7476b975 (patch)
tree615959bfd36dd30bc5c067c4501dbfb8a2e8cb8b /include/mode.h
parent79f9faeec84fbcb704b45811b9851148ab1cb20b (diff)
Add Module* creator to Command and ModeHandler
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11631 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/mode.h')
-rw-r--r--include/mode.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/mode.h b/include/mode.h
index da202c236..0f43d6db4 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -150,6 +150,9 @@ class CoreExport ModeHandler : public classbase
char prefixneeded;
public:
+ /** Module that created this mode. NULL for core modes */
+ Module* creator;
+
/**
* The constructor for ModeHandler initalizes the mode handler.
* The constructor of any class you derive from ModeHandler should
@@ -165,9 +168,12 @@ class CoreExport ModeHandler : public classbase
* In the core, the only modes to implement prefixes are +ovh (ops, voice, halfop) which define the prefix characters @, % and +
* and the rank values OP_VALUE, HALFOP_VALUE and VOICE_VALUE respectively. Any prefixes you define should have unique values proportional
* to these three defaults or proportional to another mode in a module you depend on. See src/cmode_o.cpp as an example.
+ * @param prefixrequired The prefix required to change this mode
+ * @param translate The translation type for the argument(s) of this mode
*/
- ModeHandler(InspIRCd* Instance, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly,
- char mprefix = 0, char prefixrequired = '%', TranslateType translate = TR_TEXT);
+ ModeHandler(InspIRCd* Instance, Module* me, char modeletter, int parameters_on, int parameters_off,
+ bool listmode, ModeType type, bool operonly, char mprefix = 0,
+ char prefixrequired = '%', TranslateType translate = TR_TEXT);
/**
* The default destructor does nothing
*/
@@ -321,8 +327,9 @@ class CoreExport ModeHandler : public classbase
class CoreExport SimpleUserModeHandler : public ModeHandler
{
public:
- SimpleUserModeHandler(InspIRCd* Instance, char modeletter);
- virtual ~SimpleUserModeHandler();
+ SimpleUserModeHandler(InspIRCd* Instance, Module* Creator, char modeletter)
+ : ModeHandler(Instance, Creator, modeletter, 0, 0, false, MODETYPE_USER, false) {}
+ virtual ~SimpleUserModeHandler() {}
virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode = false);
};
@@ -334,8 +341,9 @@ class CoreExport SimpleUserModeHandler : public ModeHandler
class CoreExport SimpleChannelModeHandler : public ModeHandler
{
public:
- SimpleChannelModeHandler(InspIRCd* Instance, char modeletter);
- virtual ~SimpleChannelModeHandler();
+ SimpleChannelModeHandler(InspIRCd* Instance, Module* Creator, char modeletter)
+ : ModeHandler(Instance, Creator, modeletter, 0, 0, false, MODETYPE_CHANNEL, false) {}
+ virtual ~SimpleChannelModeHandler() {}
virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode = false);
};