]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/ctables.h
Fix null dereference caused by tracking dummy
[user/henk/code/inspircd.git] / include / ctables.h
index a2f4e9bb3e68a3afce36178ef81abfd47e47dbdc..0cf4c50d2c65d27a93e96f1ce2708ae5c1308e91 100644 (file)
@@ -46,6 +46,7 @@ enum RouteType
        ROUTE_TYPE_LOCALONLY,
        ROUTE_TYPE_BROADCAST,
        ROUTE_TYPE_UNICAST,
+       ROUTE_TYPE_MESSAGE,
        ROUTE_TYPE_OPT_BCAST,
        ROUTE_TYPE_OPT_UCAST
 };
@@ -57,10 +58,10 @@ struct RouteDescriptor
 {
        /** Routing type from the enum above
         */
-       const RouteType type;
+       RouteType type;
        /** For unicast, the destination server's name
         */
-       const std::string serverdest;
+       std::string serverdest;
 
        /** Create a RouteDescriptor
         */
@@ -74,6 +75,8 @@ struct RouteDescriptor
 #define ROUTE_BROADCAST (RouteDescriptor(ROUTE_TYPE_BROADCAST, ""))
 /** Route this command to a single server (do nothing if own server name specified) */
 #define ROUTE_UNICAST(x) (RouteDescriptor(ROUTE_TYPE_UNICAST, x))
+/** Route this command as a message with the given target (any of user, #channel, @#channel, $servermask) */
+#define ROUTE_MESSAGE(x) (RouteDescriptor(ROUTE_TYPE_MESSAGE, x))
 /** Route this command to all servers wrapped via ENCAP, so ignored if not understood */
 #define ROUTE_OPT_BCAST (RouteDescriptor(ROUTE_TYPE_OPT_BCAST, ""))
 /** Route this command to a single server wrapped via ENCAP, so ignored if not understood */
@@ -87,7 +90,7 @@ class CoreExport Command : public Extensible
  public:
        /** Command name
        */
-       std::string command;
+       const std::string command;
 
        /** Creator module - never NULL */
        Module* const creator;
@@ -208,9 +211,7 @@ class CoreExport Command : public Extensible
                return works_before_reg;
        }
 
-       virtual ~Command()
-       {
-       }
+       virtual ~Command();
 };
 
 /** A hash of commands used by the core