diff options
| author | 2020-11-27 11:48:14 +0000 | |
|---|---|---|
| committer | 2020-11-27 11:48:14 +0000 | |
| commit | fc8628592a544ea146ac9085bfc18d2e2a9bae4d (patch) | |
| tree | f6776a935559a2b367854ba03e8536aef89a492c /src/modules/m_spanningtree/capab.cpp | |
| parent | Convert CapabData to be a unique_ptr. (diff) | |
Cleanup CAPAB MODULES/MODLIST now we don't need 1202 compatibility.
Diffstat (limited to 'src/modules/m_spanningtree/capab.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/capab.cpp | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index 698e0f0ba..6b47bcf93 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -136,44 +136,13 @@ void TreeSocket::SendCapabilities(int phase) if (phase < 2) return; - const char sep = ' '; - irc::sepstream modulelist(MyModules(VF_COMMON), sep); - irc::sepstream optmodulelist(MyModules(VF_OPTCOMMON), sep); - /* Send module names, split at 509 length */ - std::string item; - std::string line = "CAPAB MODULES :"; - while (modulelist.GetToken(item)) - { - if (line.length() + item.length() + 1 > 509) - { - this->WriteLine(line); - line = "CAPAB MODULES :"; - } - - if (line != "CAPAB MODULES :") - line.push_back(sep); - - line.append(item); - } - if (line != "CAPAB MODULES :") - this->WriteLine(line); + const std::string modulelist = MyModules(VF_COMMON); + if (!modulelist.empty()) + WriteLine("CAPAB MODULES :" + modulelist); - line = "CAPAB MODSUPPORT :"; - while (optmodulelist.GetToken(item)) - { - if (line.length() + item.length() + 1 > 509) - { - this->WriteLine(line); - line = "CAPAB MODSUPPORT :"; - } - - if (line != "CAPAB MODSUPPORT :") - line.push_back(sep); - - line.append(item); - } - if (line != "CAPAB MODSUPPORT :") - this->WriteLine(line); + const std::string optmodulelist = MyModules(VF_OPTCOMMON); + if (!optmodulelist.empty()) + WriteLine("CAPAB MODSUPPORT :" + optmodulelist); WriteLine("CAPAB CHANMODES :" + BuildModeList(MODETYPE_CHANNEL)); WriteLine("CAPAB USERMODES :" + BuildModeList(MODETYPE_USER)); |
