mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Handle account record the same as other records when reading storage
This commit is contained in:
parent
145962597c
commit
87016f6ecf
1 changed files with 5 additions and 16 deletions
|
@ -58,16 +58,12 @@ public class StorageHelper {
|
|||
|
||||
account.setStorageManifestVersion(manifest.get().getVersion());
|
||||
|
||||
readAccountRecord(manifest.get());
|
||||
|
||||
final var storageIds = manifest.get()
|
||||
.getStorageIds()
|
||||
.stream()
|
||||
.filter(id -> !id.isUnknown() && id.getType() != ManifestRecord.Identifier.Type.ACCOUNT_VALUE)
|
||||
.toList();
|
||||
final var storageIds = manifest.get().getStorageIds().stream().filter(id -> !id.isUnknown()).toList();
|
||||
|
||||
for (final var record : getSignalStorageRecords(storageIds)) {
|
||||
if (record.getType() == ManifestRecord.Identifier.Type.GROUPV2_VALUE) {
|
||||
if (record.getType() == ManifestRecord.Identifier.Type.ACCOUNT_VALUE) {
|
||||
readAccountRecord(record);
|
||||
} else if (record.getType() == ManifestRecord.Identifier.Type.GROUPV2_VALUE) {
|
||||
readGroupV2Record(record);
|
||||
} else if (record.getType() == ManifestRecord.Identifier.Type.GROUPV1_VALUE) {
|
||||
readGroupV1Record(record);
|
||||
|
@ -174,14 +170,7 @@ public class StorageHelper {
|
|||
}
|
||||
}
|
||||
|
||||
private void readAccountRecord(final SignalStorageManifest manifest) throws IOException {
|
||||
Optional<StorageId> accountId = manifest.getAccountStorageId();
|
||||
if (accountId.isEmpty()) {
|
||||
logger.warn("Manifest has no account record, ignoring.");
|
||||
return;
|
||||
}
|
||||
|
||||
SignalStorageRecord record = getSignalStorageRecord(accountId.get());
|
||||
private void readAccountRecord(final SignalStorageRecord record) throws IOException {
|
||||
if (record == null) {
|
||||
logger.warn("Could not find account record, even though we had an ID, ignoring.");
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue