From 58a0a7e01422e62de1565a8eb0a1febdc463d04d Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 13 Aug 2018 20:17:46 +0100 Subject: Implement IRCv3 message tag support. Co-authored-by: Attila Molnar --- include/modules/cap.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include/modules/cap.h') diff --git a/include/modules/cap.h b/include/modules/cap.h index 8299d14ae..6dcb9f3bc 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -313,4 +313,23 @@ namespace Cap return false; } }; + + class MessageBase : public ClientProtocol::Message + { + public: + MessageBase(const std::string& subcmd) + : ClientProtocol::Message("CAP", ServerInstance->Config->ServerName) + { + PushParamPlaceholder(); + PushParam(subcmd); + } + + void SetUser(LocalUser* user) + { + if (user->registered & REG_NICK) + ReplaceParamRef(0, user->nick); + else + ReplaceParam(0, "*"); + } + }; } -- cgit v1.3.1-10-gc9f91