Require desktop clients to send the new gv2-2 capability flag.

This commit is contained in:
Jon Chambers
2020-09-23 10:20:40 -04:00
committed by Jon Chambers
parent f79c998f95
commit 77de0f86dc
4 changed files with 49 additions and 69 deletions

View File

@@ -140,13 +140,7 @@ public class Account implements Principal {
public boolean isGroupsV2Supported() {
return devices.stream()
.filter(Device::isEnabled)
.allMatch(device -> {
if (device.getApnId() != null || device.getVoipApnId() != null) {
return device.getCapabilities() != null && device.getCapabilities().isGv2_2();
} else {
return device.getCapabilities() != null && (device.getCapabilities().isGv2() || device.getCapabilities().isGv2_2());
}
});
.allMatch(Device::isGroupsV2Supported);
}
public boolean isStorageSupported() {

View File

@@ -251,6 +251,14 @@ public class Device {
return this.userAgent;
}
public boolean isGroupsV2Supported() {
if (this.getGcmId() != null) {
return this.capabilities != null && (this.capabilities.isGv2() || this.capabilities.isGv2_2());
} else {
return this.capabilities != null && this.capabilities.isGv2_2();
}
}
@Override
public boolean equals(Object other) {
if (other == null || !(other instanceof Device)) return false;