diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-12-15 22:13:36 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-12-16 21:12:13 +0100 |
commit | 0bcef826baaa6a335d8fddafdbebd00fbf421c2c (patch) | |
tree | 37abb37f8b811923e25180abeac3307d15f0b9ca /src/attach.cpp | |
parent | e4b5eb30af94991e19ac324d5e6ec616e6a71d36 (diff) |
Use extended identity data for name
Diffstat (limited to 'src/attach.cpp')
-rw-r--r-- | src/attach.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/attach.cpp b/src/attach.cpp index 3d351f8..887de38 100644 --- a/src/attach.cpp +++ b/src/attach.cpp @@ -75,11 +75,19 @@ void AttachService::handlePairingResult(Context & ctx, Stored<AttachIdentity> at if (!key) throw runtime_error("failed to load secret key"); - auto id = Identity::load(key->signAdd(att->identity).ref()); + vector<StoredIdentityPart> parts = ctx.local()->identity()->extData(); + parts.emplace_back(key->signAdd(att->identity)); + filterAncestors(parts); + + auto id = Identity::load(parts); if (!id) printf("New identity validation failed\n"); - auto rid = ctx.local().ref().storage().copy(*id->ref()); + optional<Ref> tmpref = id->extRef(); + if (not tmpref) + tmpref = id->modify().commit().extRef(); + + auto rid = ctx.local().ref().storage().copy(*tmpref); id = Identity::load(rid); auto owner = id->owner(); |