mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 07:48:40 +00:00
send my public key to new members
This commit is contained in:
parent
5235a01626
commit
0d4ab84f91
2 changed files with 17 additions and 0 deletions
|
|
@ -165,6 +165,9 @@ Future<bool> handleGroupJoin(
|
|||
if (await twonlyDB.contactsDao.getContactById(fromUserId) == null) {
|
||||
if (!await addNewHiddenContact(fromUserId)) {
|
||||
Log.error('Got group join, but could not load contact.');
|
||||
// This can happen in case the group join was received before the group create.
|
||||
// In this case return false, which will cause the receipt to fail and the user
|
||||
// will resend this message.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,6 +261,20 @@ Future<(int, EncryptedGroupState)?> fetchGroupState(Group group) async {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Send the new user my public group key
|
||||
if (group.myGroupPrivateKey != null) {
|
||||
final keyPair =
|
||||
IdentityKeyPair.fromSerialized(group.myGroupPrivateKey!);
|
||||
await sendCipherText(
|
||||
memberId.toInt(),
|
||||
EncryptedContent(
|
||||
groupJoin: EncryptedContent_GroupJoin(
|
||||
groupPublicKey: keyPair.getPublicKey().serialize(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// check if there is a member which is not in the server list...
|
||||
|
|
|
|||
Loading…
Reference in a new issue