mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +01:00
add the contact group and local group if it doesnt already exist
This commit is contained in:
@@ -256,6 +256,8 @@ class SocialBackupManagerImpl extends BdfIncomingMessageHook
|
|||||||
new BackupMetadata(secret, authors, threshold, 0);
|
new BackupMetadata(secret, authors, threshold, 0);
|
||||||
BdfDictionary meta =
|
BdfDictionary meta =
|
||||||
backupMetadataEncoder.encodeBackupMetadata(backupMetadata);
|
backupMetadataEncoder.encodeBackupMetadata(backupMetadata);
|
||||||
|
|
||||||
|
if (!db.containsGroup(txn, localGroup.getId())) db.addGroup(txn, localGroup);
|
||||||
clientHelper.mergeGroupMetadata(txn, localGroup.getId(), meta);
|
clientHelper.mergeGroupMetadata(txn, localGroup.getId(), meta);
|
||||||
} catch (FormatException e) {
|
} catch (FormatException e) {
|
||||||
throw new AssertionError(e);
|
throw new AssertionError(e);
|
||||||
@@ -323,7 +325,9 @@ class SocialBackupManagerImpl extends BdfIncomingMessageHook
|
|||||||
|
|
||||||
private void sendShardMessage(Transaction txn, Contact custodian,
|
private void sendShardMessage(Transaction txn, Contact custodian,
|
||||||
Shard shard) throws DbException, FormatException {
|
Shard shard) throws DbException, FormatException {
|
||||||
GroupId g = getContactGroup(custodian).getId();
|
Group group = getContactGroup(custodian);
|
||||||
|
GroupId g = group.getId();
|
||||||
|
if (!db.containsGroup(txn, g)) db.addGroup(txn, group);
|
||||||
long timestamp = clock.currentTimeMillis();
|
long timestamp = clock.currentTimeMillis();
|
||||||
byte[] body = messageEncoder.encodeShardMessage(shard);
|
byte[] body = messageEncoder.encodeShardMessage(shard);
|
||||||
Message m = clientHelper.createMessage(g, timestamp, body);
|
Message m = clientHelper.createMessage(g, timestamp, body);
|
||||||
|
|||||||
Reference in New Issue
Block a user