From d0bb6bd79a7909b498ad018b4a9f6f90d4e89787 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 24 Sep 2020 00:04:04 +0100 Subject: Fix the syntax of the MAXLIST 005 token. --- src/coremods/core_channel/core_channel.cpp | 22 ++++------------------ 1 file 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 limits; + std::vector 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::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()) { -- cgit v1.2.3