diff options
Diffstat (limited to 'src/coremods')
-rw-r--r-- | src/coremods/core_channel/core_channel.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/coremods/core_channel/core_channel.cpp b/src/coremods/core_channel/core_channel.cpp index e95736ccc..b989f8778 100644 --- a/src/coremods/core_channel/core_channel.cpp +++ b/src/coremods/core_channel/core_channel.cpp @@ -205,16 +205,20 @@ class CoreModChannel : public Module, public CheckExemption::EventListener { tokens["KEYLEN"] = ConvToStr(ModeChannelKey::maxkeylen); - // Build a map of limits to their mode character. insp::flat_map<int, 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) { - const unsigned int limit = (*iter)->GetLowerLimit(); - limits[limit].push_back((*iter)->GetModeChar()); + ListModeBase* lm = *iter; + + const unsigned int limit = lm->GetLowerLimit(); + limits[limit].push_back(lm->GetModeChar()); + + if (lm->HasVariableLength()) + vlist.push_back(lm->GetModeChar()); } - // Generate the MAXLIST token from the limits map. std::string& buffer = tokens["MAXLIST"]; for (insp::flat_map<int, std::string>::const_iterator iter = limits.begin(); iter != limits.end(); ++iter) { @@ -228,6 +232,12 @@ class CoreModChannel : public Module, public CheckExemption::EventListener buffer.push_back(':'); buffer.append(ConvToStr(iter->first)); } + + if (!vlist.empty()) + { + tokens["VBANLIST"]; // deprecated + tokens["VLIST"] = vlist; + } } ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string&, std::string&, const std::string& keygiven) CXX11_OVERRIDE |