diff options
author | Sadie Powell <sadie@witchery.services> | 2024-02-21 20:45:38 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-02-22 00:14:08 +0000 |
commit | aefbb4fbdab80a41c3f88566abcba4b92b2d36d5 (patch) | |
tree | 81b6ba768c99606101fbce39d54d9d521d1a1e20 /modules/protocol/bahamut.cpp | |
parent | 9b77fdf5b680e4a084effe56345a9d01cfbf6f11 (diff) |
Rework SendModeInternal to be usable with Uplink::Send.
Diffstat (limited to 'modules/protocol/bahamut.cpp')
-rw-r--r-- | modules/protocol/bahamut.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index 56efb5ce4..a82f63bd8 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -47,19 +47,23 @@ public: MaxModes = 60; } - void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) override + void SendModeInternal(const MessageSource &source, Channel *chan, const Anope::string &modes, const std::vector<Anope::string> &values) override { if (Servers::Capab.count("TSMODE") > 0) { - UplinkSocket::Message(source) << "MODE " << dest->name << " " << dest->creation_time << " " << buf; + auto params = values; + params.insert(params.begin(), { chan->name, stringify(chan->creation_time), modes }); + Uplink::SendInternal({}, source, "MODE", params); } else - IRCDProto::SendModeInternal(source, dest, buf); + IRCDProto::SendModeInternal(source, chan, modes, values); } - 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->nick << " " << u->timestamp << " " << buf; + auto params = values; + params.insert(params.begin(), { u->nick, stringify(u->timestamp), modes }); + Uplink::SendInternal({}, source, "SVSMODE", params); } void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override @@ -283,12 +287,12 @@ public: void SendLogin(User *u, NickAlias *) override { - IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %ld", (unsigned long)u->signon); + IRCD->SendMode(Config->GetClient("NickServ"), u, "+d", u->signon); } void SendLogout(User *u) override { - IRCD->SendMode(Config->GetClient("NickServ"), u, "+d 1"); + IRCD->SendMode(Config->GetClient("NickServ"), u, "+d", 1); } }; |