diff options
author | Sadie Powell <sadie@witchery.services> | 2020-01-16 15:23:40 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-01-16 15:23:40 +0000 |
commit | 8df3d792bc99d9dd73db7a601ebe8d4a397c3522 (patch) | |
tree | 5360406208cda4e50b7b2d38441b3d269b542778 | |
parent | 130e4e9b43bd6d9190474eadb4ddbb2c50f6279a (diff) |
Fix STATUSMSG tag messages not including the status in the target.
-rw-r--r-- | include/modules/ctctags.h | 28 | ||||
-rw-r--r-- | src/modules/m_ircv3_ctctags.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_ircv3_echomessage.cpp | 2 |
3 files changed, 26 insertions, 6 deletions
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); } }; diff --git a/src/modules/m_ircv3_ctctags.cpp b/src/modules/m_ircv3_ctctags.cpp index d0012b752..98e3d38c9 100644 --- a/src/modules/m_ircv3_ctctags.cpp +++ b/src/modules/m_ircv3_ctctags.cpp @@ -82,7 +82,7 @@ class CommandTagMsg : public Command return CMD_FAILURE; unsigned int minrank = pm ? pm->GetPrefixRank() : 0; - CTCTags::TagMessage message(source, chan, msgdetails.tags_out); + CTCTags::TagMessage message(source, chan, msgdetails.tags_out, msgtarget.status); message.SetSideEffect(true); const Channel::MemberMap& userlist = chan->GetUsers(); for (Channel::MemberMap::const_iterator iter = userlist.begin(); iter != userlist.end(); ++iter) diff --git a/src/modules/m_ircv3_echomessage.cpp b/src/modules/m_ircv3_echomessage.cpp index 28cf6b53a..bd54e844e 100644 --- a/src/modules/m_ircv3_echomessage.cpp +++ b/src/modules/m_ircv3_echomessage.cpp @@ -99,7 +99,7 @@ class ModuleIRCv3EchoMessage case MessageTarget::TYPE_CHANNEL: { Channel* chan = target.Get<Channel>(); - CTCTags::TagMessage message(user, chan, tags); + CTCTags::TagMessage message(user, chan, tags, target.status); localuser->Send(tagmsgprov, message); break; } |