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

Rework SendModeInternal to be usable with Uplink::Send.

This commit is contained in:
Sadie Powell
2024-02-21 20:45:38 +00:00
parent 9b77fdf5b6
commit aefbb4fbda
9 changed files with 79 additions and 64 deletions
+6 -4
View File
@@ -205,15 +205,17 @@ public:
UplinkSocket::Message(Me) << "EOB";
}
void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) override
void SendModeInternal(const MessageSource &source, User* u, const Anope::string &modes, const std::vector<Anope::string> &values) override
{
UplinkSocket::Message(source) << "SVSMODE " << u->GetUID() << " " << u->timestamp << " " << buf;
auto params = values;
params.insert(params.begin(), { u->GetUID(), stringify(u->timestamp), modes });
Uplink::SendInternal({}, source, "SVSMODE", params);
}
void SendLogin(User *u, NickAlias *na) override
{
if (UseSVSAccount == false)
IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %s", na->nc->display.c_str());
IRCD->SendMode(Config->GetClient("NickServ"), u, "+d", na->nc->display);
else
UplinkSocket::Message(Me) << "SVSACCOUNT " << u->GetUID() << " " << u->timestamp << " " << na->nc->display;
}
@@ -221,7 +223,7 @@ public:
void SendLogout(User *u) override
{
if (UseSVSAccount == false)
IRCD->SendMode(Config->GetClient("NickServ"), u, "+d *");
IRCD->SendMode(Config->GetClient("NickServ"), u, "+d", '*');
else
UplinkSocket::Message(Me) << "SVSACCOUNT " << u->GetUID() << " " << u->timestamp << " *";
}