diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/grpc/DeviceCapabilityUtil.java b/service/src/main/java/org/whispersystems/textsecuregcm/grpc/DeviceCapabilityUtil.java index 47e410913..a2b79c13f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/grpc/DeviceCapabilityUtil.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/grpc/DeviceCapabilityUtil.java @@ -19,6 +19,7 @@ public class DeviceCapabilityUtil { case DEVICE_CAPABILITY_ATTACHMENT_BACKFILL -> DeviceCapability.ATTACHMENT_BACKFILL; case DEVICE_CAPABILITY_SPARSE_POST_QUANTUM_RATCHET -> DeviceCapability.SPARSE_POST_QUANTUM_RATCHET; case DEVICE_CAPABILITY_PROFILES_V2 -> DeviceCapability.PROFILES_V2; + case DEVICE_CAPABILITY_USERNAME_CHANGE_SYNC_MESSAGE -> DeviceCapability.USERNAME_CHANGE_SYNC_MESSAGE; case DEVICE_CAPABILITY_UNSPECIFIED, UNRECOGNIZED -> throw GrpcExceptions.invalidArguments("unrecognized device capability"); }; @@ -31,6 +32,7 @@ public class DeviceCapabilityUtil { case ATTACHMENT_BACKFILL -> org.signal.chat.common.DeviceCapability.DEVICE_CAPABILITY_ATTACHMENT_BACKFILL; case SPARSE_POST_QUANTUM_RATCHET -> org.signal.chat.common.DeviceCapability.DEVICE_CAPABILITY_SPARSE_POST_QUANTUM_RATCHET; case PROFILES_V2 -> org.signal.chat.common.DeviceCapability.DEVICE_CAPABILITY_PROFILES_V2; + case USERNAME_CHANGE_SYNC_MESSAGE -> org.signal.chat.common.DeviceCapability.DEVICE_CAPABILITY_USERNAME_CHANGE_SYNC_MESSAGE; }; } } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/DeviceCapability.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/DeviceCapability.java index 108205a42..28450a17b 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/DeviceCapability.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/DeviceCapability.java @@ -16,7 +16,8 @@ public enum DeviceCapability { TRANSFER("transfer", AccountCapabilityMode.PRIMARY_DEVICE, false, false, false), ATTACHMENT_BACKFILL("attachmentBackfill", AccountCapabilityMode.PRIMARY_DEVICE, false, true, false), SPARSE_POST_QUANTUM_RATCHET("spqr", AccountCapabilityMode.ALL_DEVICES, true, true, true), - PROFILES_V2("profiles_v2", AccountCapabilityMode.ALL_DEVICES, false, true, false); + PROFILES_V2("profiles_v2", AccountCapabilityMode.ALL_DEVICES, false, true, false), + USERNAME_CHANGE_SYNC_MESSAGE("usernameChangeSyncMessage", AccountCapabilityMode.ALL_DEVICES, true, true, false); public enum AccountCapabilityMode { /** diff --git a/service/src/main/proto/org/signal/chat/common.proto b/service/src/main/proto/org/signal/chat/common.proto index 99b3c2b23..3c2c640ac 100644 --- a/service/src/main/proto/org/signal/chat/common.proto +++ b/service/src/main/proto/org/signal/chat/common.proto @@ -84,6 +84,7 @@ enum DeviceCapability { DEVICE_CAPABILITY_ATTACHMENT_BACKFILL = 6; DEVICE_CAPABILITY_SPARSE_POST_QUANTUM_RATCHET = 7; DEVICE_CAPABILITY_PROFILES_V2 = 8; + DEVICE_CAPABILITY_USERNAME_CHANGE_SYNC_MESSAGE = 9; } message ZkCredential { diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/grpc/DevicesGrpcServiceTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/grpc/DevicesGrpcServiceTest.java index 4f0809abd..269290ed8 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/grpc/DevicesGrpcServiceTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/grpc/DevicesGrpcServiceTest.java @@ -426,9 +426,9 @@ class DevicesGrpcServiceTest extends SimpleBaseGrpcTest expectedCapabilities = new HashSet<>(); @@ -474,6 +478,10 @@ class DevicesGrpcServiceTest extends SimpleBaseGrpcTest