diff options
| author | 2021-04-01 18:48:35 +0100 | |
|---|---|---|
| committer | 2021-04-01 19:03:40 +0100 | |
| commit | 834c11f6e92862955c015529a89fb7a353e3a842 (patch) | |
| tree | 197f0be1d25b03d738fdede3eab36dc91c7bfe74 /src/modules/m_spanningtree/netburst.cpp | |
| parent | Constify variables within loops. (diff) | |
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.
Diffstat (limited to 'src/modules/m_spanningtree/netburst.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/netburst.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
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); |
