From 8df3d792bc99d9dd73db7a601ebe8d4a397c3522 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 16 Jan 2020 15:23:40 +0000 Subject: Fix STATUSMSG tag messages not including the status in the target. --- include/modules/ctctags.h | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/modules/ctctags.h b/include/modules/ctctags.h index d0f0f83bd..6b7f81a4c 100644 --- a/include/modules/ctctags.h +++ b/include/modules/ctctags.h @@ -30,11 +30,24 @@ namespace CTCTags class CTCTags::TagMessage : public ClientProtocol::Message { +private: + void PushTarget(const char* target, char status) + { + if (status) + { + std::string rawtarget(1, status); + rawtarget.append(target); + PushParam(rawtarget); + } + else + PushParamRef(target); + } + public: - TagMessage(User* source, const Channel* targetchan, const ClientProtocol::TagMap& Tags) + TagMessage(User* source, const Channel* targetchan, const ClientProtocol::TagMap& Tags, char status = 0) : ClientProtocol::Message("TAGMSG", source) { - PushParamRef(targetchan->name); + PushTarget(targetchan->name.c_str(), status); AddTags(Tags); } @@ -48,10 +61,17 @@ class CTCTags::TagMessage : public ClientProtocol::Message AddTags(Tags); } - TagMessage(User* source, const char* targetstr, const ClientProtocol::TagMap& Tags) + TagMessage(User* source, const char* targetstr, const ClientProtocol::TagMap& Tags, char status = 0) : ClientProtocol::Message("TAGMSG", source) { - PushParam(targetstr); + PushTarget(targetstr, status); + AddTags(Tags); + } + + TagMessage(const char* sourcestr, const char* targetstr, const ClientProtocol::TagMap& Tags, char status = 0) + : ClientProtocol::Message("TAGMSG", sourcestr) + { + PushTarget(targetstr, status); AddTags(Tags); } }; -- cgit v1.2.3