mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-02 06:33:38 +01:00
Add support for restoring usernames post-registration.
This commit is contained in:
@@ -794,6 +794,17 @@ public class SignalServiceAccountManager {
|
||||
}
|
||||
}
|
||||
|
||||
public UsernameLinkComponents reclaimUsernameAndLink(Username username, UsernameLinkComponents linkComponents) throws IOException {
|
||||
try {
|
||||
UsernameLink link = username.generateLink(linkComponents.getEntropy());
|
||||
UUID serverId = this.pushServiceSocket.confirmUsernameAndCreateNewLink(username, link);
|
||||
|
||||
return new UsernameLinkComponents(link.getEntropy(), serverId);
|
||||
} catch (BaseUsernameException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
}
|
||||
|
||||
public UsernameLinkComponents updateUsernameLink(UsernameLink newUsernameLink) throws IOException {
|
||||
UUID serverId = this.pushServiceSocket.createUsernameLink(Base64.encodeUrlSafeWithoutPadding(newUsernameLink.getEncryptedUsername()), true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user