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:
+5
-12
@@ -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> ¶ms)
|
||||
{
|
||||
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)
|
||||
{
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user