From 834c11f6e92862955c015529a89fb7a353e3a842 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 1 Apr 2021 18:48:35 +0100 Subject: Add support for syncing metadata set on memberships. No compat logic is required here as existing servers will just drop the unknown METADATA message when they can't find the target. --- src/modules/m_spanningtree/netburst.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (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 9b9fa7d87..bc7c41841 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -248,12 +248,21 @@ void TreeSocket::SyncChannel(Channel* chan, BurstState& bs) SendListModes(chan); - for (Extensible::ExtensibleStore::const_iterator i = chan->GetExtList().begin(); i != chan->GetExtList().end(); i++) + for (const auto& [item, value] : chan->GetExtList()) { - ExtensionItem* item = i->first; - std::string value = item->ToNetwork(chan, i->second); - if (!value.empty()) - this->WriteLine(CommandMetadata::Builder(chan, item->name, value)); + const std::string valuestr = item->ToNetwork(chan, value); + if (!valuestr.empty()) + this->WriteLine(CommandMetadata::Builder(chan, item->name, valuestr)); + } + + for (const auto& [_, memb] : chan->GetUsers()) + { + for (const auto& [item, value] : memb->GetExtList()) + { + const std::string valuestr = item->ToNetwork(memb, value); + if (!valuestr.empty()) + this->WriteLine(CommandMetadata::Builder(memb, item->name, valuestr)); + } } Utils->Creator->GetSyncEventProvider().Call(&ServerProtocol::SyncEventListener::OnSyncChannel, chan, bs.server); -- cgit v1.3.1-10-gc9f91