]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/message.h
Bump the InspIRCd ABI version.
[user/henk/code/inspircd.git] / include / message.h
index fb9e7619f70b473a1be57902578f99808cab6952..1624a1de42df747410247dc162bd08e690bfec87 100644 (file)
@@ -32,14 +32,23 @@ enum MessageType
 class CoreExport MessageDetails
 {
  public:
+       /** Whether to echo the message at all. */
+       bool echo;
+
        /* Whether to send the original message back to clients with echo-message support. */
-       bool echooriginal;
+       bool echo_original;
 
         /** The users who are exempted from receiving this message. */
        CUList exemptions;
 
        /* The original message as sent by the user. */
-       const std::string originaltext;
+       const std::string original_text;
+
+       /** IRCv3 message tags sent to the server by the user. */
+       const ClientProtocol::TagMap tags_in;
+
+       /** IRCv3 message tags sent out to users who get this message. */
+       ClientProtocol::TagMap tags_out;
 
        /** The message which will be sent to clients. */
        std::string text;
@@ -47,9 +56,29 @@ class CoreExport MessageDetails
        /** The type of message. */
        const MessageType type;
 
-       MessageDetails(MessageType mt, const std::string& msg)
-               : echooriginal(false)
-               , originaltext(msg)
+       /** Determines whether the specified message is a CTCP. If the specified message
+        * is a CTCP then the CTCP name and CTCP body are extracted and stored in the
+        * name and body references.
+        * @param name The location to store the parsed CTCP name.
+        * @param body The location to store the parsed CTCP body.
+        */
+       virtual bool IsCTCP(std::string& name, std::string& body) const = 0;
+
+       /** Determines whether the specified message is a CTCP. If the specified message
+        * is a CTCP then the CTCP name is extracted and stored in the name reference.
+        * @param name The location to store the parsed CTCP name.
+        */
+       virtual bool IsCTCP(std::string& name) const = 0;
+
+       /** Determines whether the specified message is a CTCP. */
+       virtual bool IsCTCP() const = 0;
+
+ protected:
+       MessageDetails(MessageType mt, const std::string& msg, const ClientProtocol::TagMap& tags)
+               : echo(true)
+               , echo_original(false)
+               , original_text(msg)
+               , tags_in(tags)
                , text(msg)
                , type(mt)
        {