1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 02:56:38 +02:00

Make CTCP support more modular.

This commit is contained in:
Sadie Powell
2025-05-10 14:15:27 +01:00
parent 7b2f0f5790
commit 50030e07fa
3 changed files with 35 additions and 10 deletions
+3 -10
View File
@@ -340,16 +340,9 @@ void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> &param
Anope::string ctcpname, ctcpbody;
if (Anope::ParseCTCP(message, ctcpname, ctcpbody))
{
if (ctcpname.equals_ci("PING"))
{
IRCD->SendNotice(bi, u->nick, Anope::FormatCTCP("PING", ctcpbody));
}
else if (ctcpname.equals_ci("VERSION"))
{
Module *enc = ModuleManager::FindFirstOf(ENCRYPTION);
IRCD->SendNotice(bi, u->nick, Anope::FormatCTCP("VERSION", Anope::printf("Anope-%s %s -- %s -- %s", Anope::Version().c_str(),
Anope::VersionBuildString().c_str(), IRCD->GetProtocolName().c_str(), enc ? enc->name.c_str() : "(none)")));
}
auto ctcpit = bi->ctcps.find(ctcpname);
if (ctcpit != bi->ctcps.end())
ctcpit->second(bi, u, ctcpbody);
return;
}