From 67a03f81b9274b3038296eb46bafe31f51adce6b Mon Sep 17 00:00:00 2001 From: Ravi Khadiwala Date: Mon, 29 Jun 2026 10:55:52 -0500 Subject: [PATCH] Add username_link_handle to AccountIdentifiers message --- .../textsecuregcm/grpc/AccountsGrpcService.java | 4 ++++ service/src/main/proto/org/signal/chat/common.proto | 8 ++++++-- .../textsecuregcm/grpc/AccountsGrpcServiceTest.java | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcService.java b/service/src/main/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcService.java index 2ffa22c51..afe0a8bb8 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcService.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcService.java @@ -94,6 +94,10 @@ public class AccountsGrpcService extends SimpleAccountsGrpc.AccountsImplBase { account.getUsernameHash().ifPresent(usernameHash -> accountIdentifiersBuilder.setUsernameHash(ByteString.copyFrom(usernameHash))); + if (account.getUsernameLinkHandle() != null) { + accountIdentifiersBuilder.setUsernameLinkHandle(UUIDUtil.toByteString(account.getUsernameLinkHandle())); + } + return GetAccountIdentityResponse.newBuilder() .setAccountIdentifiers(accountIdentifiersBuilder) .build(); diff --git a/service/src/main/proto/org/signal/chat/common.proto b/service/src/main/proto/org/signal/chat/common.proto index 91cd753d8..4e49ae536 100644 --- a/service/src/main/proto/org/signal/chat/common.proto +++ b/service/src/main/proto/org/signal/chat/common.proto @@ -30,11 +30,15 @@ message AccountIdentifiers { repeated ServiceIdentifier service_identifiers = 1; // The phone number associated with the identified account. - string e164 = 2; + string e164 = 2 [(org.signal.chat.require.e164) = true]; // The username hash (if any) associated with the identified account. May be // empty if no username is associated with the identified account. - bytes username_hash = 3; + bytes username_hash = 3 [(org.signal.chat.require.exactlySize) = 0, (org.signal.chat.require.exactlySize) = 32]; + + // The username link handle UUID associated with the identified account. + // May be empty if no username is associated with the identified account. + bytes username_link_handle = 4 [(org.signal.chat.require.exactlySize) = 0, (org.signal.chat.require.exactlySize) = 16]; } message EcPreKey { diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java index 765ddec1f..1ae033e1d 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java @@ -121,12 +121,14 @@ class AccountsGrpcServiceTest extends SimpleBaseGrpcTest