From 09e3e7f3358313e68487b1b5ab240837326844dc Mon Sep 17 00:00:00 2001 From: AsamK Date: Wed, 1 May 2024 09:07:39 +0200 Subject: [PATCH] Rotate storageId after setting username --- .../java/org/asamk/signal/manager/helper/AccountHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/AccountHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/AccountHelper.java index 85c9b2208..5c74a37fd 100644 --- a/lib/src/main/java/org/asamk/signal/manager/helper/AccountHelper.java +++ b/lib/src/main/java/org/asamk/signal/manager/helper/AccountHelper.java @@ -376,6 +376,7 @@ private void reserveUsername(final List candidates) throws IOException account.setUsername(username.getUsername()); account.setUsernameLink(linkComponents); account.getRecipientStore().resolveSelfRecipientTrusted(account.getSelfRecipientAddress()); + account.getRecipientStore().rotateSelfStorageId(); logger.debug("[confirmUsername] Successfully confirmed username."); } @@ -409,6 +410,7 @@ public void refreshCurrentUsername() throws IOException, BaseUsernameException { e.getClass().getSimpleName()); account.setUsername(null); account.setUsernameLink(null); + account.getRecipientStore().rotateSelfStorageId(); throw e; } } else { @@ -431,6 +433,7 @@ private void tryReserveConfirmUsername(final Username username) throws IOExcepti account.setUsernameLink(linkComponents); logger.debug("[confirmUsername] Successfully reclaimed existing username and link."); } + account.getRecipientStore().rotateSelfStorageId(); } private void tryToSetUsernameLink(Username username) {