Skip to content

Commit

Permalink
Fix various storage service issues.
Browse files Browse the repository at this point in the history
Resolves #13466
  • Loading branch information
AsamK authored and cody-signal committed Mar 19, 2024
1 parent 742c348 commit 5e1ebaa
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
Expand Up @@ -411,10 +411,7 @@ private static void processKnownRecords(@NonNull Context context, @NonNull Stora
new GroupV1RecordProcessor(context).process(records.gv1, StorageSyncHelper.KEY_GENERATOR);
new GroupV2RecordProcessor(context).process(records.gv2, StorageSyncHelper.KEY_GENERATOR);
new AccountRecordProcessor(context, freshSelf()).process(records.account, StorageSyncHelper.KEY_GENERATOR);

if (getKnownTypes().contains(ManifestRecord.Identifier.Type.STORY_DISTRIBUTION_LIST.getValue())) {
new StoryDistributionListRecordProcessor().process(records.storyDistributionLists, StorageSyncHelper.KEY_GENERATOR);
}
new StoryDistributionListRecordProcessor().process(records.storyDistributionLists, StorageSyncHelper.KEY_GENERATOR);
}

private static @NonNull List<StorageId> getAllLocalStorageIds(@NonNull Recipient self) {
Expand Down
Expand Up @@ -157,6 +157,7 @@ boolean isInvalid(@NonNull SignalAccountRecord remote) {
.setPrimarySendsSms(primarySendsSms)
.setDefaultReactions(defaultReactions)
.setSubscriber(subscriber)
.setStoryViewReceiptsState(storyViewReceiptsState)
.setDisplayBadgesOnProfile(displayBadgesOnProfile)
.setSubscriptionManuallyCancelled(subscriptionManuallyCancelled)
.setKeepMutedChatsArchived(keepMutedChatsArchived)
Expand Down
Expand Up @@ -262,7 +262,7 @@ void updateLocal(@NonNull StorageRecordUpdate<SignalContactRecord> update) {

@Override
public int compare(@NonNull SignalContactRecord lhs, @NonNull SignalContactRecord rhs) {
if (Objects.equals(lhs.getAci(), rhs.getAci()) ||
if ((lhs.getAci().isPresent() && Objects.equals(lhs.getAci(), rhs.getAci())) ||
(lhs.getNumber().isPresent() && Objects.equals(lhs.getNumber(), rhs.getNumber())) ||
(lhs.getPni().isPresent() && Objects.equals(lhs.getPni(), rhs.getPni())))
{
Expand Down
Expand Up @@ -92,7 +92,8 @@ boolean isInvalid(@NonNull SignalGroupV1Record remote) {
} else {
return new SignalGroupV1Record.Builder(keyGenerator.generate(), remote.getGroupId(), unknownFields)
.setBlocked(blocked)
.setProfileSharingEnabled(blocked)
.setProfileSharingEnabled(profileSharing)
.setArchived(archived)
.setForcedUnread(forcedUnread)
.setMuteUntil(muteUntil)
.build();
Expand Down
Expand Up @@ -85,7 +85,7 @@ boolean isInvalid(@NonNull SignalGroupV2Record remote) {
} else {
return new SignalGroupV2Record.Builder(keyGenerator.generate(), remote.getMasterKeyBytes(), unknownFields)
.setBlocked(blocked)
.setProfileSharingEnabled(blocked)
.setProfileSharingEnabled(profileSharing)
.setArchived(archived)
.setForcedUnread(forcedUnread)
.setMuteUntil(muteUntil)
Expand Down

0 comments on commit 5e1ebaa

Please sign in to comment.