diff options
-rw-r--r-- | include/mode.h | 13 | ||||
-rw-r--r-- | src/mode.cpp | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/include/mode.h b/include/mode.h index 9b8d07877..18fed8b0a 100644 --- a/include/mode.h +++ b/include/mode.h @@ -100,6 +100,12 @@ enum ParamSpec */ class CoreExport ModeHandler : public ServiceProvider { + public: + enum Class + { + MC_OTHER + }; + /** * Removes this prefix mode from all users on the given channel * @param channel The channel which the server wants to remove your mode from @@ -150,6 +156,10 @@ class CoreExport ModeHandler : public ServiceProvider */ ModeType m_type; + /** The object type of this mode handler + */ + const Class type_id; + /** The prefix char needed on channel to use this mode, * only checked for channel modes */ @@ -170,8 +180,9 @@ class CoreExport ModeHandler : public ServiceProvider * @param modeletter The mode letter you wish to handle * @param params Parameters taken by the mode * @param type Type of the mode (MODETYPE_USER or MODETYPE_CHANNEL) + * @param mclass The object type of this mode handler, one of ModeHandler::Class */ - ModeHandler(Module* me, const std::string& name, char modeletter, ParamSpec params, ModeType type); + ModeHandler(Module* me, const std::string& name, char modeletter, ParamSpec params, ModeType type, Class mclass = MC_OTHER); virtual CullResult cull(); virtual ~ModeHandler(); /** diff --git a/src/mode.cpp b/src/mode.cpp index 15f5c0d60..b76e1558f 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -26,10 +26,10 @@ #include "inspircd.h" #include "builtinmodes.h" -ModeHandler::ModeHandler(Module* Creator, const std::string& Name, char modeletter, ParamSpec Params, ModeType type) +ModeHandler::ModeHandler(Module* Creator, const std::string& Name, char modeletter, ParamSpec Params, ModeType type, Class mclass) : ServiceProvider(Creator, Name, SERVICE_MODE), m_paramtype(TR_TEXT), parameters_taken(Params), mode(modeletter), prefix(0), oper(false), - list(false), m_type(type), levelrequired(HALFOP_VALUE), prefixrank(0) + list(false), m_type(type), type_id(mclass), levelrequired(HALFOP_VALUE), prefixrank(0) { } |