aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/netburst.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-03-30 18:48:16 +0100
committerGravatar Sadie Powell2021-03-30 19:05:21 +0100
commitd121f8d4cfdd422c0cff2201bd344d4ad3027878 (patch)
treebabccb9a51259412694b8c51968186318f1e343a /src/modules/m_spanningtree/netburst.cpp
parentFix a compiler warning caused by an unused variable. (diff)
Fix the setter and set time of list modes being lost on netburst.
Closes #1812.
Diffstat (limited to 'src/modules/m_spanningtree/netburst.cpp')
-rw-r--r--src/modules/m_spanningtree/netburst.cpp24
1 files changed, 24 insertions, 0 deletions
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
@@ -197,6 +197,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())
{