summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-03-11 05:37:15 +0000
committerSadie Powell <sadie@witchery.services>2021-03-11 05:37:15 +0000
commit8fcb8ee6d6542b533e132bc8958a895553ee8371 (patch)
tree5029e8dce4818554664fc2799af29c343304d713 /include
parente0dc7691c4cff3a38bc12adf10b3709d8c4901ba (diff)
Add support for sending a standard reply with no command name.
Diffstat (limited to 'include')
-rw-r--r--include/modules/ircv3_replies.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/include/modules/ircv3_replies.h b/include/modules/ircv3_replies.h
index f3c5c451a..f9b58fdf6 100644
--- a/include/modules/ircv3_replies.h
+++ b/include/modules/ircv3_replies.h
@@ -91,7 +91,10 @@ class IRCv3::Replies::Reply
void Send(LocalUser* user, Command* command, const std::string& code, const std::string& description)
{
ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
- msg.PushParamRef(command->name);
+ if (command)
+ msg.PushParamRef(command->name);
+ else
+ msg.PushParam("*");
msg.PushParam(code);
msg.PushParam(description);
SendInternal(user, msg);
@@ -101,7 +104,10 @@ class IRCv3::Replies::Reply
void Send(LocalUser* user, Command* command, const std::string& code, const T1& p1, const std::string& description)
{
ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
- msg.PushParamRef(command->name);
+ if (command)
+ msg.PushParamRef(command->name);
+ else
+ msg.PushParam("*");
msg.PushParam(code);
msg.PushParam(ConvToStr(p1));
msg.PushParam(description);
@@ -113,7 +119,10 @@ class IRCv3::Replies::Reply
const std::string& description)
{
ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
- msg.PushParamRef(command->name);
+ if (command)
+ msg.PushParamRef(command->name);
+ else
+ msg.PushParam("*");
msg.PushParam(code);
msg.PushParam(ConvToStr(p1));
msg.PushParam(ConvToStr(p2));
@@ -126,7 +135,10 @@ class IRCv3::Replies::Reply
const T3& p3, const std::string& description)
{
ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
- msg.PushParamRef(command->name);
+ if (command)
+ msg.PushParamRef(command->name);
+ else
+ msg.PushParam("*");
msg.PushParam(code);
msg.PushParam(ConvToStr(p1));
msg.PushParam(ConvToStr(p2));
@@ -140,7 +152,10 @@ class IRCv3::Replies::Reply
const T3& p3, const T4& p4, const std::string& description)
{
ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
- msg.PushParamRef(command->name);
+ if (command)
+ msg.PushParamRef(command->name);
+ else
+ msg.PushParam("*");
msg.PushParam(code);
msg.PushParam(ConvToStr(p1));
msg.PushParam(ConvToStr(p2));