GroupsV2Operations groupsV2Operations;
try {
- groupsV2Operations = new GroupsV2Operations(ClientZkOperations.create(serviceEnvironmentConfig.getSignalServiceConfiguration()));
+ groupsV2Operations = new GroupsV2Operations(ClientZkOperations.create(serviceEnvironmentConfig.getSignalServiceConfiguration()),
+ ServiceConfig.GROUP_MAX_SIZE);
} catch (Throwable ignored) {
groupsV2Operations = null;
}
@Override
public void register(boolean voiceVerification, String captcha) throws IOException, CaptchaRequiredException {
+ if (account.isRegistered()
+ && account.getServiceEnvironment() != null
+ && account.getServiceEnvironment() != serviceEnvironmentConfig.getType()) {
+ throw new IOException("Account is registered in another environment: " + account.getServiceEnvironment());
+ }
+
if (account.getAci() != null && attemptReactivateAccount()) {
return;
}
}
}
+ @Override
+ public void deleteLocalAccountData() throws IOException {
+ account.deleteAccountData();
+ accountFileUpdater.removeAccount();
+ account = null;
+ }
+
+ @Override
+ public boolean isRegistered() {
+ return account.isRegistered();
+ }
+
private boolean attemptReactivateAccount() {
try {
final var accountManager = new SignalServiceAccountManager(serviceEnvironmentConfig.getSignalServiceConfiguration(),