From 3af819e28bf6c41919610a0f8c9bf18f4b1e0274 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sat, 5 Aug 2023 01:15:08 -0400 Subject: [PATCH] fixes --- lib/components/paste_invite_dialog.dart | 9 ++++++++- lib/providers/contact.dart | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/components/paste_invite_dialog.dart b/lib/components/paste_invite_dialog.dart index d52614b..b5153c7 100644 --- a/lib/components/paste_invite_dialog.dart +++ b/lib/components/paste_invite_dialog.dart @@ -107,7 +107,7 @@ class PasteInviteDialogState extends ConsumerState { var lastline = lines.indexWhere((element) => element.contains('END VEILIDCHAT')); - if (lastline != -1) { + if (lastline == -1) { lastline = lines.length; } if (lastline <= firstline) { @@ -127,6 +127,13 @@ class PasteInviteDialogState extends ConsumerState { final contactRequestInboxKey = proto.TypedKeyProto.fromProto( contactInvitation.contactRequestInboxKey); + // xxx should ensure contact request is not from ourselves + // xxx or implement as 'note to self' but this could be done more carefully + // xxx this operation gets the wrong parent. can we allow opening dht records + // xxx that we already have open for readonly? + + // xxx test on multiple devices + // Open context request inbox subkey zero to get the contact request object final pool = await DHTRecordPool.instance(); await (await pool.openRead(contactRequestInboxKey)) diff --git a/lib/providers/contact.dart b/lib/providers/contact.dart index c694555..a36151c 100644 --- a/lib/providers/contact.dart +++ b/lib/providers/contact.dart @@ -93,7 +93,7 @@ Future createContactInvitation( final crpriv = ContactRequestPrivate() ..writerKey = writer.key.toProto() ..profile = activeAccountInfo.account.profile - ..accountMasterRecordKey = + ..identityMasterRecordKey = activeAccountInfo.userLogin.accountMasterRecordKey.toProto() ..chatRecordKey = localConversation.key.toProto() ..expiration = expiration?.toInt64() ?? Int64.ZERO;