Skip to content

Commit

Permalink
Prefer remote value for profile sharing during storage sync.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Sep 24, 2020
1 parent 9cf7eec commit 864a1d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ContactConflictMerger implements StorageSyncHelper.ConflictMerger<SignalCo
IdentityState identityState = remote.getIdentityState();
byte[] identityKey = remote.getIdentityKey().or(local.getIdentityKey()).orNull();
boolean blocked = remote.isBlocked();
boolean profileSharing = remote.isProfileSharingEnabled() || local.isProfileSharingEnabled();
boolean profileSharing = remote.isProfileSharingEnabled();
boolean archived = remote.isArchived();
boolean matchesRemote = doParamsMatch(remote, unknownFields, address, givenName, familyName, profileKey, username, identityState, identityKey, blocked, profileSharing, archived);
boolean matchesLocal = doParamsMatch(local, unknownFields, address, givenName, familyName, profileKey, username, identityState, identityKey, blocked, profileSharing, archived);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class ContactConflictMergerTest {
}

@Test
public void merge_alwaysPreferRemote_exceptProfileSharingIsEitherOr() {
public void merge_alwaysPreferRemote() {
SignalContactRecord remote = new SignalContactRecord.Builder(byteArray(1), new SignalServiceAddress(UUID_A, E164_A))
.setBlocked(true)
.setIdentityKey(byteArray(2))
Expand Down Expand Up @@ -79,7 +79,7 @@ public void merge_alwaysPreferRemote_exceptProfileSharingIsEitherOr() {
assertEquals("AFirst", merged.getGivenName().get());
assertEquals("ALast", merged.getFamilyName().get());
assertEquals("username A", merged.getUsername().get());
assertTrue(merged.isProfileSharingEnabled());
assertFalse(merged.isProfileSharingEnabled());
assertFalse(merged.isArchived());
}

Expand Down

0 comments on commit 864a1d5

Please sign in to comment.