From 0bcef826baaa6a335d8fddafdbebd00fbf421c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Fri, 15 Dec 2023 22:13:36 +0100 Subject: Use extended identity data for name --- src/attach.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/attach.cpp') 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 at if (!key) throw runtime_error("failed to load secret key"); - auto id = Identity::load(key->signAdd(att->identity).ref()); + vector 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 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(); -- cgit v1.2.3