Drop the UUID addressing capability flag entirely.

This commit is contained in:
Jon Chambers
2020-09-14 11:58:56 -04:00
committed by Jon Chambers
parent a567f4a6de
commit ebc3a251b7
9 changed files with 36 additions and 59 deletions

View File

@@ -197,7 +197,7 @@ public class ProfileController {
accountProfile.get().getIdentityKey(),
UnidentifiedAccessChecksum.generateFor(accountProfile.get().getUnidentifiedAccessKey()),
accountProfile.get().isUnrestrictedUnidentifiedAccess(),
new UserCapabilities(accountProfile.get().isUuidAddressingSupported(), accountProfile.get().isGroupsV2Supported()),
new UserCapabilities(accountProfile.get().isGroupsV2Supported()),
username.orElse(null),
null,
credential.orElse(null),
@@ -235,7 +235,7 @@ public class ProfileController {
accountProfile.get().getIdentityKey(),
UnidentifiedAccessChecksum.generateFor(accountProfile.get().getUnidentifiedAccessKey()),
accountProfile.get().isUnrestrictedUnidentifiedAccess(),
new UserCapabilities(accountProfile.get().isUuidAddressingSupported(), accountProfile.get().isGroupsV2Supported()),
new UserCapabilities(accountProfile.get().isGroupsV2Supported()),
username,
accountProfile.get().getUuid(),
null,
@@ -308,7 +308,7 @@ public class ProfileController {
accountProfile.get().getIdentityKey(),
UnidentifiedAccessChecksum.generateFor(accountProfile.get().getUnidentifiedAccessKey()),
accountProfile.get().isUnrestrictedUnidentifiedAccess(),
new UserCapabilities(accountProfile.get().isUuidAddressingSupported(), accountProfile.get().isGroupsV2Supported()),
new UserCapabilities(accountProfile.get().isGroupsV2Supported()),
username.orElse(null),
null,
null,

View File

@@ -3,23 +3,15 @@ package org.whispersystems.textsecuregcm.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
public class UserCapabilities {
@JsonProperty
private boolean uuid;
@JsonProperty
private boolean gv2;
public UserCapabilities() {}
public UserCapabilities(boolean uuid, boolean gv2) {
this.uuid = uuid;
public UserCapabilities(boolean gv2) {
this.gv2 = gv2;
}
public boolean isUuid() {
return uuid;
}
public boolean isGv2() {
return gv2;
}

View File

@@ -137,12 +137,6 @@ public class Account implements Principal {
return Optional.empty();
}
public boolean isUuidAddressingSupported() {
return devices.stream()
.filter(Device::isEnabled)
.allMatch(device -> device.getCapabilities() != null && device.getCapabilities().isUuid());
}
public boolean isGroupsV2Supported() {
return devices.stream()
.filter(Device::isEnabled)

View File

@@ -267,9 +267,6 @@ public class Device {
}
public static class DeviceCapabilities {
@JsonProperty
private boolean uuid;
@JsonProperty
private boolean gv2;
@@ -281,17 +278,12 @@ public class Device {
public DeviceCapabilities() {}
public DeviceCapabilities(boolean uuid, boolean gv2, boolean storage, boolean transfer) {
this.uuid = uuid;
public DeviceCapabilities(boolean gv2, boolean storage, boolean transfer) {
this.gv2 = gv2;
this.storage = storage;
this.transfer = transfer;
}
public boolean isUuid() {
return uuid;
}
public boolean isGv2() {
return gv2;
}