summaryrefslogtreecommitdiff
path: root/modules/protocol/unrealircd.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-10-02 11:11:16 +0100
committerSadie Powell <sadie@witchery.services>2024-10-02 11:12:24 +0100
commit8232759a924e5bd8f7fa5a425dcb930bba4ef3fb (patch)
treeb112914c4a945e04bb35e4de0e05deaca33a6b4d /modules/protocol/unrealircd.cpp
parentb006966d25888857f777892fd3412d8c6da6af5d (diff)
Change Channel::SetModesInternal to take a split mode change.
Diffstat (limited to 'modules/protocol/unrealircd.cpp')
-rw-r--r--modules/protocol/unrealircd.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/modules/protocol/unrealircd.cpp b/modules/protocol/unrealircd.cpp
index 1a3b7145a..83cac4dc6 100644
--- a/modules/protocol/unrealircd.cpp
+++ b/modules/protocol/unrealircd.cpp
@@ -1147,10 +1147,7 @@ struct IRCDMessageMode final
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override
{
auto final_is_ts = server_ts && source.GetServer() != NULL;
-
- Anope::string modes = params[1];
- for (unsigned i = 2; i < params.size() - (final_is_ts ? 1 : 0); ++i)
- modes += " " + params[i];
+ auto last_param = params.end() - (final_is_ts ? 1 : 0);
if (IRCD->IsChannelValid(params[0]))
{
@@ -1158,7 +1155,7 @@ struct IRCDMessageMode final
auto ts = final_is_ts ? IRCD->ExtractTimestamp(params.back()) : 0;
if (c)
- c->SetModesInternal(source, modes, ts);
+ c->SetModesInternal(source, params[2], { params.begin() + 3, last_param }, ts);
}
else
{
@@ -1420,11 +1417,12 @@ struct IRCDMessageSJoin final
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override
{
Anope::string modes;
+ std::vector<Anope::string> modeparams;
if (params.size() >= 4)
- for (unsigned i = 2; i < params.size() - 1; ++i)
- modes += " " + params[i];
- if (!modes.empty())
- modes.erase(modes.begin());
+ {
+ modes = params[2];
+ modeparams = { params.begin() + 3, params.end() };
+ }
std::list<Anope::string> bans, excepts, invites;
std::list<Message::Join::SJoinUser> users;
@@ -1474,7 +1472,7 @@ struct IRCDMessageSJoin final
}
auto ts = IRCD->ExtractTimestamp(params[0]);
- Message::Join::SJoin(source, params[1], ts, modes, users);
+ Message::Join::SJoin(source, params[1], ts, modes, modeparams, users);
if (!bans.empty() || !excepts.empty() || !invites.empty())
{