diff options
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(); +} |