diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/coremods/core_channel/core_channel.cpp | 18 | ||||
-rw-r--r-- | src/server.cpp | 1 |
2 files changed, 14 insertions, 5 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 diff --git a/src/server.cpp b/src/server.cpp index f2abfe0e2..39d30e37a 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -201,7 +201,6 @@ void ISupportManager::Build() tokens["STATUSMSG"] = ServerInstance->Modes->BuildPrefixes(false); tokens["TOPICLEN"] = ConvToStr(ServerInstance->Config->Limits.MaxTopic); tokens["USERLEN"] = ConvToStr(ServerInstance->Config->Limits.IdentMax); - tokens["VBANLIST"]; // Modules can add new tokens and also edit or remove existing tokens FOREACH_MOD(On005Numeric, (tokens)); |