invitation work

This commit is contained in:
Christien Rioux 2023-08-04 01:00:38 -04:00
parent 95ed8b28a0
commit 7496a1a2a7
22 changed files with 591 additions and 47 deletions

View file

@ -131,15 +131,22 @@ extension IdentityMasterExtension on IdentityMaster {
// Create new account to insert into identity
await (await pool.create(parent: identityRec.key))
.deleteScope((accountRec) async {
// Make empty contact list
final contactList =
await (await DHTShortArray.create(parent: accountRec.key))
.scope((r) => r.record.ownedDHTRecordPointer);
// Make empty contact invitation record list
final contactInvitationRecords = await (await DHTShortArray.create())
.scope((r) => r.record.ownedDHTRecordPointer);
final contactInvitationRecords =
await (await DHTShortArray.create(parent: accountRec.key))
.scope((r) => r.record.ownedDHTRecordPointer);
// Make account object
final account = proto.Account()
..profile = (proto.Profile()
..name = name
..title = title)
..contactList = contactList.toProto()
..contactInvitationRecords = contactInvitationRecords.toProto();
// Write account key