diff options
| author | 2021-06-04 01:58:33 +0100 | |
|---|---|---|
| committer | 2021-06-04 02:03:52 +0100 | |
| commit | 722c63ad53dea99829cf010786354e21016aadef (patch) | |
| tree | fef353397be82e774f387ca15db407a13b16d65b /src/modules/m_spanningtree/utils.cpp | |
| parent | Send the CHARSET token if using a non-ascii casemapping. (diff) | |
Broadcast the limits for list modes on server link.
This allows services to not overflow the limit.
Diffstat (limited to 'src/modules/m_spanningtree/utils.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 809963625..84d96e098 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -25,6 +25,7 @@ #include "inspircd.h" +#include "listmode.h" #include "main.h" #include "utils.h" @@ -374,3 +375,24 @@ void SpanningTreeUtilities::SendChannelMessage(User* source, Channel* target, co Sock->WriteLine(msg); } } + +void SpanningTreeUtilities::SendListLimits(Channel* chan, TreeSocket* sock) +{ + std::stringstream buffer; + const ModeParser::ListModeList& listmodes = ServerInstance->Modes->GetListModes(); + for (ModeParser::ListModeList::const_iterator i = listmodes.begin(); i != listmodes.end(); ++i) + { + ListModeBase* lm = *i; + buffer << lm->GetModeChar() << " " << lm->GetLimit(chan) << " "; + } + + std::string bufferstr = buffer.str(); + if (bufferstr.empty()) + return; // Should never happen. + + bufferstr.erase(bufferstr.end() - 1); + if (sock) + sock->WriteLine(CommandMetadata::Builder(chan, "maxlist", bufferstr)); + else + CommandMetadata::Builder(chan, "maxlist", bufferstr).Broadcast(); +} |
