From d121f8d4cfdd422c0cff2201bd344d4ad3027878 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 30 Mar 2021 18:48:16 +0100 Subject: Fix the setter and set time of list modes being lost on netburst. Closes #1812. --- src/modules/m_spanningtree/netburst.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/modules/m_spanningtree/netburst.cpp') diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 183fbd7c3..9b9fa7d87 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -196,6 +196,30 @@ void TreeSocket::SendXLines() } void TreeSocket::SendListModes(Channel* chan) +{ + if (proto_version < PROTO_INSPIRCD_40_A1) + { + SendLegacyListModes(chan); + return; + } + + for (const auto& mode : ServerInstance->Modes.GetListModes()) + { + ListModeBase::ModeList* list = mode->GetList(chan); + if (!list || list->empty()) + continue; + + CmdBuilder lmode("LMODE"); + lmode.push(chan->name).push_int(chan->age).push(mode->GetModeChar()); + + for (const auto& entry : *list) + lmode.push(entry.mask).push(entry.setter).push_int(entry.time); + + this->WriteLine(lmode.str()); + } +} + +void TreeSocket::SendLegacyListModes(Channel* chan) { FModeBuilder fmode(chan); for (const auto& mode : ServerInstance->Modes.GetListModes()) -- cgit v1.3.1-10-gc9f91