summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-06-24 13:29:41 +0100
committerSadie Powell <sadie@witchery.services>2024-06-24 13:30:17 +0100
commit6e5713d64a379fc64c7ff6658362d02b3618c3ca (patch)
tree013fe8b9831fb514502b7f07669929bd484ee45d /src
parent249ad3dfea933310f10947cc03f6fe85ab116b81 (diff)
Remove the formatting overloads of SendNotice/SendPrivmsg.
Diffstat (limited to 'src')
-rw-r--r--src/logger.cpp2
-rw-r--r--src/protocol.cpp32
-rw-r--r--src/users.cpp4
3 files changed, 9 insertions, 29 deletions
diff --git a/src/logger.cpp b/src/logger.cpp
index 6290831be..677258009 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -364,7 +364,7 @@ void LogInfo::ProcessMessage(const Log *l)
if (!bi)
bi = c->WhoSends();
if (bi)
- IRCD->SendPrivmsg(bi, c->name, "%s", buffer.c_str());
+ IRCD->SendPrivmsg(bi, c->name, buffer);
}
}
else if (target == "globops")
diff --git a/src/protocol.cpp b/src/protocol.cpp
index c1685eb27..275721634 100644
--- a/src/protocol.cpp
+++ b/src/protocol.cpp
@@ -135,12 +135,12 @@ void IRCDProto::SendKick(const MessageSource &source, const Channel *c, User *u,
Uplink::Send(source, "KICK", c->name, u->GetUID());
}
-void IRCDProto::SendNoticeInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
+void IRCDProto::SendNotice(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
{
Uplink::Send(tags, source, "NOTICE", dest, msg.empty() ? " " : msg);
}
-void IRCDProto::SendPrivmsgInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
+void IRCDProto::SendPrivmsg(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
{
Uplink::Send(tags, source, "PRIVMSG", dest, msg.empty() ? " " : msg);
}
@@ -169,7 +169,7 @@ void IRCDProto::SendGlobops(const MessageSource &source, const Anope::string &me
void IRCDProto::SendCTCPInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &buf)
{
Anope::string s = Anope::NormalizeBuffer(buf);
- this->SendNoticeInternal(source, dest, "\1" + s + "\1");
+ this->SendNotice(source, dest, "\1" + s + "\1");
}
void IRCDProto::SendNumericInternal(int numeric, const Anope::string &dest, const std::vector<Anope::string> &params)
@@ -190,16 +190,6 @@ void IRCDProto::SendTopic(const MessageSource &source, Channel *c)
Uplink::Send(source, "TOPIC", c->name, c->topic);
}
-void IRCDProto::SendNotice(const MessageSource &source, 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);
- SendNoticeInternal(source, dest, buf);
-}
-
void IRCDProto::SendAction(const MessageSource &source, const Anope::string &dest, const char *fmt, ...)
{
va_list args;
@@ -208,17 +198,7 @@ void IRCDProto::SendAction(const MessageSource &source, const Anope::string &des
vsnprintf(buf, BUFSIZE - 1, fmt, args);
va_end(args);
Anope::string actionbuf = Anope::string("\1ACTION ") + buf + '\1';
- SendPrivmsgInternal(source, dest, actionbuf);
-}
-
-void IRCDProto::SendPrivmsg(const MessageSource &source, 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);
- SendPrivmsgInternal(source, dest, buf);
+ SendPrivmsg(source, dest, actionbuf);
}
void IRCDProto::SendPing(const Anope::string &servname, const Anope::string &who)
@@ -370,14 +350,14 @@ Anope::string IRCDProto::NormalizeMask(const Anope::string &mask)
void IRCDProto::SendContextNotice(BotInfo *bi, User *target, Channel *context, const Anope::string &msg)
{
- IRCD->SendNoticeInternal(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
+ IRCD->SendNotice(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
{ "+draft/channel-context", context->name },
});
}
void IRCDProto::SendContextPrivmsg(BotInfo *bi, User *target, Channel *context, const Anope::string &msg)
{
- IRCD->SendPrivmsgInternal(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
+ IRCD->SendPrivmsg(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
{ "+draft/channel-context", context->name },
});
}
diff --git a/src/users.cpp b/src/users.cpp
index 9462881f1..9b370ea06 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -337,9 +337,9 @@ namespace
for (Anope::string tok; sep.GetToken(tok);)
{
if (target->ShouldPrivmsg())
- IRCD->SendPrivmsgInternal(source, target->GetUID(), tok, tags);
+ IRCD->SendPrivmsg(source, target->GetUID(), tok, tags);
else
- IRCD->SendNoticeInternal(source, target->GetUID(), tok, tags);
+ IRCD->SendNotice(source, target->GetUID(), tok, tags);
}
}
}