mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 17:08:23 +01:00
add an option to replace username ciphertext without rotating the link handle
This commit is contained in:
committed by
GitHub
parent
a4a4204762
commit
a83378a44e
@@ -267,7 +267,12 @@ public class AccountsGrpcService extends ReactorAccountsGrpc.AccountsImplBase {
|
||||
.asRuntimeException());
|
||||
}
|
||||
|
||||
final UUID linkHandle = UUID.randomUUID();
|
||||
final UUID linkHandle;
|
||||
if (request.getKeepLinkHandle() && account.getUsernameLinkHandle() != null) {
|
||||
linkHandle = account.getUsernameLinkHandle();
|
||||
} else {
|
||||
linkHandle = UUID.randomUUID();
|
||||
}
|
||||
|
||||
return Mono.fromFuture(() -> accountsManager.updateAsync(account, a -> a.setUsernameLinkDetails(linkHandle, request.getUsernameCiphertext().toByteArray())))
|
||||
.thenReturn(linkHandle);
|
||||
|
||||
Reference in New Issue
Block a user