From 4567a325b8cfc87ddf1aea1c0db7623d3b068931 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 27 Apr 2018 14:30:06 +0100 Subject: Implement proper CTCP parsing in MessageDetails. --- include/message.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include') diff --git a/include/message.h b/include/message.h index 8c7c7592a..7a968d866 100644 --- a/include/message.h +++ b/include/message.h @@ -56,6 +56,24 @@ class CoreExport MessageDetails /** The type of message. */ const MessageType type; + /** 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) -- cgit v1.2.3