]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add a type id field to ModeHandler
authorattilamolnar <attilamolnar@hush.com>
Sun, 1 Sep 2013 12:17:04 +0000 (14:17 +0200)
committerattilamolnar <attilamolnar@hush.com>
Wed, 11 Sep 2013 10:10:07 +0000 (12:10 +0200)
include/mode.h
src/mode.cpp

index 9b8d07877d2a98bbe55ac016cadf737f71e86aa1..18fed8b0ab86bec9f897b790ff0b8e28b922c478 100644 (file)
@@ -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();
        /**
index 15f5c0d60aec6e5bfaf892ae6f500df1ceaf980d..b76e1558f13d5cb31b6e6e7e66d2701d32997908 100644 (file)
 #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)
 {
 }