diff options
| author | 2022-01-21 15:53:04 +0000 | |
|---|---|---|
| committer | 2022-01-21 16:36:43 +0000 | |
| commit | a51d044c82d2e39a2d9a79dd2ce181ef7bd32b02 (patch) | |
| tree | 3df8fc518ec12122c4096431d521d9deef58b5b0 /src/extensible.cpp | |
| parent | Fix aliases which require routing to be broadcast out. (diff) | |
Fix various edge cases in extensible synchronisation.
- Fix not forwarding the accountid extensible if it is set.
- Rename the variadic Set() overload to SetFwd().
- Re-add the `const T&` overload of Set().
- Move `bool synced` to SimpleExtItem from StringExtItem.
- Only sync extensibles if their instance is marked as syncable.
Diffstat (limited to 'src/extensible.cpp')
| -rw-r--r-- | src/extensible.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/extensible.cpp b/src/extensible.cpp index 641d62337..1e02fc526 100644 --- a/src/extensible.cpp +++ b/src/extensible.cpp @@ -232,14 +232,14 @@ bool BoolExtItem::Get(const Extensible* container) const void BoolExtItem::Set(Extensible* container, bool sync) { SetRaw(container, reinterpret_cast<void*>(1)); - if (sync) + if (sync && synced) Sync(container, reinterpret_cast<void*>(1)); } void BoolExtItem::Unset(Extensible* container, bool sync) { UnsetRaw(container); - if (sync) + if (sync && synced) Sync(container, reinterpret_cast<void*>(0)); } @@ -299,8 +299,7 @@ void IntExtItem::Unset(Extensible* container, bool sync) } StringExtItem::StringExtItem(Module* owner, const std::string& key, ExtensionType exttype, bool sync) - : SimpleExtItem(owner, key, exttype) - , synced(sync) + : SimpleExtItem(owner, key, exttype, sync) { } |
