/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2019-2021 Sadie Powell <sadie@witchery.services>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* redistribute it and/or modify it under the terms of the GNU General Public
void SendNoticeInternal(LocalUser* user, Command* command, const std::string& description)
{
- user->WriteNotice(InspIRCd::Format("*** %s: %s", command->name.c_str(), description.c_str()));
+ if (command)
+ user->WriteNotice(InspIRCd::Format("*** %s: %s", command->name.c_str(), description.c_str()));
+ else
+ user->WriteNotice(InspIRCd::Format("*** %s", description.c_str()));
}
protected:
*/
void Send(LocalUser* user, Command* command, const std::string& code, const std::string& description)
{
- ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName);
- msg.PushParamRef(command->name);
+ ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
+ if (command)
+ msg.PushParamRef(command->name);
+ else
+ msg.PushParam("*");
msg.PushParam(code);
msg.PushParam(description);
SendInternal(user, msg);
template<typename T1>
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->ServerName);
- msg.PushParamRef(command->name);
+ ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
+ if (command)
+ msg.PushParamRef(command->name);
+ else
+ msg.PushParam("*");
msg.PushParam(code);
msg.PushParam(ConvToStr(p1));
msg.PushParam(description);
void Send(LocalUser* user, Command* command, const std::string& code, const T1& p1, const T2& p2,
const std::string& description)
{
- ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName);
- msg.PushParamRef(command->name);
+ ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
+ if (command)
+ msg.PushParamRef(command->name);
+ else
+ msg.PushParam("*");
msg.PushParam(code);
msg.PushParam(ConvToStr(p1));
msg.PushParam(ConvToStr(p2));
void Send(LocalUser* user, Command* command, const std::string& code, const T1& p1, const T2& p2,
const T3& p3, const std::string& description)
{
- ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName);
- msg.PushParamRef(command->name);
+ ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
+ if (command)
+ msg.PushParamRef(command->name);
+ else
+ msg.PushParam("*");
msg.PushParam(code);
msg.PushParam(ConvToStr(p1));
msg.PushParam(ConvToStr(p2));
void Send(LocalUser* user, Command* command, const std::string& code, const T1& p1, const T2& p2,
const T3& p3, const T4& p4, const std::string& description)
{
- ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName);
- msg.PushParamRef(command->name);
+ ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
+ if (command)
+ msg.PushParamRef(command->name);
+ else
+ msg.PushParam("*");
msg.PushParam(code);
msg.PushParam(ConvToStr(p1));
msg.PushParam(ConvToStr(p2));
void Send(LocalUser* user, Command* command, const std::string& code, const T1& p1, const T2& p2,
const T3& p3, const T4& p4, const T5& p5, const std::string& description)
{
- ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName);
+ ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName());
if (command)
msg.PushParamRef(command->name);
else