mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-03 11:49:04 -04:00
checkpoint
This commit is contained in:
parent
3edf2ebb46
commit
c40f835ec5
25 changed files with 378 additions and 312 deletions
|
@ -140,8 +140,18 @@ class CreateInvitationDialogState extends State<CreateInvitationDialog> {
|
|||
// Start generation
|
||||
final contactInvitationListCubit =
|
||||
widget.modalContext.read<ContactInvitationListCubit>();
|
||||
final profile = widget.modalContext
|
||||
.read<AccountRecordCubit>()
|
||||
.state
|
||||
.asData
|
||||
?.value
|
||||
.profile;
|
||||
if (profile == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final generator = contactInvitationListCubit.createInvitation(
|
||||
profile: profile,
|
||||
encryptionKeyType: _encryptionKeyType,
|
||||
encryptionKey: _encryptionKey,
|
||||
message: _messageTextController.text,
|
||||
|
|
|
@ -76,17 +76,19 @@ class InvitationDialogState extends State<InvitationDialog> {
|
|||
final navigator = Navigator.of(context);
|
||||
final accountInfo = widget._locator<AccountInfoCubit>().state;
|
||||
final contactList = widget._locator<ContactListCubit>();
|
||||
final profile =
|
||||
widget._locator<AccountRecordCubit>().state.asData!.value.profile;
|
||||
|
||||
setState(() {
|
||||
_isAccepting = true;
|
||||
});
|
||||
final validInvitation = _validInvitation;
|
||||
if (validInvitation != null) {
|
||||
final acceptedContact = await validInvitation.accept();
|
||||
final acceptedContact = await validInvitation.accept(profile);
|
||||
if (acceptedContact != null) {
|
||||
// initiator when accept is received will create
|
||||
// contact in the case of a 'note to self'
|
||||
final isSelf = accountInfo.unlockedAccountInfo!.identityPublicKey ==
|
||||
final isSelf = accountInfo.identityPublicKey ==
|
||||
acceptedContact.remoteIdentity.currentInstance.publicKey;
|
||||
if (!isSelf) {
|
||||
await contactList.createContact(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue