1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 20:16:36 +02:00

Rework SendNumericInternal to be usable with Uplink::Send.

This commit is contained in:
Sadie Powell
2024-02-21 19:43:21 +00:00
parent 7a6979c814
commit 9b77fdf5b6
5 changed files with 39 additions and 39 deletions
+5 -12
View File
@@ -150,14 +150,17 @@ void IRCDProto::SendCTCPInternal(const MessageSource &source, const Anope::strin
this->SendNoticeInternal(source, dest, "\1" + s + "\1");
}
void IRCDProto::SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf)
void IRCDProto::SendNumericInternal(int numeric, const Anope::string &dest, const std::vector<Anope::string> &params)
{
Anope::string n = stringify(numeric);
if (numeric < 10)
n = "0" + n;
if (numeric < 100)
n = "0" + n;
UplinkSocket::Message(Me) << n << " " << dest << " " << buf;
auto newparams = params;
newparams.insert(newparams.begin(), dest);
Uplink::SendInternal({}, Me, n, newparams);
}
void IRCDProto::SendTopic(const MessageSource &source, Channel *c)
@@ -329,16 +332,6 @@ void IRCDProto::SendCTCP(const MessageSource &source, const Anope::string &dest,
SendCTCPInternal(source, dest, buf);
}
void IRCDProto::SendNumeric(int numeric, const Anope::string &dest, const char *fmt, ...)
{
va_list args;
char buf[BUFSIZE] = "";
va_start(args, fmt);
vsnprintf(buf, BUFSIZE - 1, fmt, args);
va_end(args);
SendNumericInternal(numeric, dest, buf);
}
bool IRCDProto::IsNickValid(const Anope::string &nick)
{
/**