mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-09 22:52:29 -04:00
xfer
This commit is contained in:
parent
64d4d0cefb
commit
41bb198d92
40 changed files with 1623 additions and 1272 deletions
|
@ -1,3 +1,5 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:veilid_support/veilid_support.dart';
|
||||
|
||||
|
@ -22,6 +24,20 @@ class ActiveAccountInfo {
|
|||
return KeyPair(key: identityKey, secret: identitySecret.value);
|
||||
}
|
||||
|
||||
Future<DHTRecordCrypto> makeConversationCrypto(
|
||||
TypedKey remoteIdentityPublicKey) async {
|
||||
final identitySecret = userLogin.identitySecret;
|
||||
final cs = await Veilid.instance.getCryptoSystem(identitySecret.kind);
|
||||
final sharedSecret = await cs.generateSharedSecret(
|
||||
remoteIdentityPublicKey.value,
|
||||
identitySecret.value,
|
||||
utf8.encode('VeilidChat Conversation'));
|
||||
|
||||
final messagesCrypto = await DHTRecordCryptoPrivate.fromSecret(
|
||||
identitySecret.kind, sharedSecret);
|
||||
return messagesCrypto;
|
||||
}
|
||||
|
||||
//
|
||||
final LocalAccount localAccount;
|
||||
final UserLogin userLogin;
|
||||
|
|
|
@ -218,18 +218,18 @@ class AccountRepository {
|
|||
// Make empty contact list
|
||||
log.debug('Creating contacts list');
|
||||
final contactList = await (await DHTShortArray.create(parent: parent))
|
||||
.scope((r) async => r.record.ownedDHTRecordPointer);
|
||||
.scope((r) async => r.recordPointer);
|
||||
|
||||
// Make empty contact invitation record list
|
||||
log.debug('Creating contact invitation records list');
|
||||
final contactInvitationRecords =
|
||||
await (await DHTShortArray.create(parent: parent))
|
||||
.scope((r) async => r.record.ownedDHTRecordPointer);
|
||||
.scope((r) async => r.recordPointer);
|
||||
|
||||
// Make empty chat record list
|
||||
log.debug('Creating chat records list');
|
||||
final chatRecords = await (await DHTShortArray.create(parent: parent))
|
||||
.scope((r) async => r.record.ownedDHTRecordPointer);
|
||||
.scope((r) async => r.recordPointer);
|
||||
|
||||
// Make account object
|
||||
final account = proto.Account()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue