summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-09-24 00:04:04 +0100
committerSadie Powell <sadie@witchery.services>2020-09-24 00:04:04 +0100
commitd0bb6bd79a7909b498ad018b4a9f6f90d4e89787 (patch)
tree1f2053976e49c794a9747139613e4767951d4f43 /src
parent9cdd7c70ee8faa2d8d37078aa188423a7abfa214 (diff)
Fix the syntax of the MAXLIST 005 token.
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_channel/core_channel.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/coremods/core_channel/core_channel.cpp b/src/coremods/core_channel/core_channel.cpp
index 385c5404c..db17925b0 100644
--- a/src/coremods/core_channel/core_channel.cpp
+++ b/src/coremods/core_channel/core_channel.cpp
@@ -209,33 +209,19 @@ class CoreModChannel : public Module, public CheckExemption::EventListener
{
tokens["KEYLEN"] = ConvToStr(ModeChannelKey::maxkeylen);
- insp::flat_map<int, std::string> limits;
+ std::vector<std::string> limits;
std::string vlist;
const ModeParser::ListModeList& listmodes = ServerInstance->Modes->GetListModes();
for (ModeParser::ListModeList::const_iterator iter = listmodes.begin(); iter != listmodes.end(); ++iter)
{
ListModeBase* lm = *iter;
-
- const unsigned int limit = lm->GetLowerLimit();
- limits[limit].push_back(lm->GetModeChar());
-
+ limits.push_back(InspIRCd::Format("%c:%u", lm->GetModeChar(), lm->GetLowerLimit()));
if (lm->HasVariableLength())
vlist.push_back(lm->GetModeChar());
}
- std::string& buffer = tokens["MAXLIST"];
- for (insp::flat_map<int, std::string>::const_iterator iter = limits.begin(); iter != limits.end(); ++iter)
- {
- if (!buffer.empty())
- buffer.push_back(',');
-
- std::string modes(iter->second);
- std::sort(modes.begin(), modes.end());
-
- buffer.append(modes);
- buffer.push_back(':');
- buffer.append(ConvToStr(iter->first));
- }
+ std::sort(limits.begin(), limits.end());
+ tokens["MAXLIST"] = stdalgo::string::join(limits, ',');
if (!vlist.empty())
{