summaryrefslogtreecommitdiff
path: root/src/state.cpp
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2022-04-27 22:45:00 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2022-04-29 23:39:12 +0200
commit8b180ffd0551831931cdb61c925987f9014adad8 (patch)
tree88162e869672823469da1f2894370335ea38dde5 /src/state.cpp
parent2d63b112d3700729536966d8553787c50f028dd4 (diff)
Local identity with shared state updates
Diffstat (limited to 'src/state.cpp')
-rw-r--r--src/state.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/state.cpp b/src/state.cpp
index 82fe907..6ad9f89 100644
--- a/src/state.cpp
+++ b/src/state.cpp
@@ -25,6 +25,14 @@ LocalState::LocalState(const Ref & ref):
for (auto i : rec->items("shared"))
if (const auto & x = i.as<SharedData>())
p->shared.tip.push_back(*x);
+
+ if (p->identity) {
+ vector<Stored<Signed<IdentityData>>> updates;
+ for (const auto & r : lookupShared(SharedType<optional<Identity>>::id))
+ updates.push_back(Stored<Signed<IdentityData>>::load(r));
+ if (!updates.empty())
+ p->identity = p->identity->update(updates);
+ }
}
Ref LocalState::store(const Storage & st) const