mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Prevent groupV2Operations from being null
This commit is contained in:
parent
fddf982832
commit
81d2e315e3
2 changed files with 5 additions and 9 deletions
|
@ -60,6 +60,7 @@ public class RegistrationManagerImpl implements RegistrationManager {
|
||||||
private final ServiceEnvironmentConfig serviceEnvironmentConfig;
|
private final ServiceEnvironmentConfig serviceEnvironmentConfig;
|
||||||
private final String userAgent;
|
private final String userAgent;
|
||||||
private final Consumer<Manager> newManagerListener;
|
private final Consumer<Manager> newManagerListener;
|
||||||
|
private final GroupsV2Operations groupsV2Operations;
|
||||||
|
|
||||||
private final SignalServiceAccountManager accountManager;
|
private final SignalServiceAccountManager accountManager;
|
||||||
private final PinHelper pinHelper;
|
private final PinHelper pinHelper;
|
||||||
|
@ -80,13 +81,8 @@ public class RegistrationManagerImpl implements RegistrationManager {
|
||||||
this.userAgent = userAgent;
|
this.userAgent = userAgent;
|
||||||
this.newManagerListener = newManagerListener;
|
this.newManagerListener = newManagerListener;
|
||||||
|
|
||||||
GroupsV2Operations groupsV2Operations;
|
groupsV2Operations = new GroupsV2Operations(ClientZkOperations.create(serviceEnvironmentConfig.signalServiceConfiguration()),
|
||||||
try {
|
ServiceConfig.GROUP_MAX_SIZE);
|
||||||
groupsV2Operations = new GroupsV2Operations(ClientZkOperations.create(serviceEnvironmentConfig.signalServiceConfiguration()),
|
|
||||||
ServiceConfig.GROUP_MAX_SIZE);
|
|
||||||
} catch (Throwable ignored) {
|
|
||||||
groupsV2Operations = null;
|
|
||||||
}
|
|
||||||
this.accountManager = new SignalServiceAccountManager(serviceEnvironmentConfig.signalServiceConfiguration(),
|
this.accountManager = new SignalServiceAccountManager(serviceEnvironmentConfig.signalServiceConfiguration(),
|
||||||
new DynamicCredentialsProvider(
|
new DynamicCredentialsProvider(
|
||||||
// Using empty UUID, because registering doesn't work otherwise
|
// Using empty UUID, because registering doesn't work otherwise
|
||||||
|
@ -210,7 +206,7 @@ public class RegistrationManagerImpl implements RegistrationManager {
|
||||||
final var accountManager = new SignalServiceAccountManager(serviceEnvironmentConfig.signalServiceConfiguration(),
|
final var accountManager = new SignalServiceAccountManager(serviceEnvironmentConfig.signalServiceConfiguration(),
|
||||||
account.getCredentialsProvider(),
|
account.getCredentialsProvider(),
|
||||||
userAgent,
|
userAgent,
|
||||||
null,
|
groupsV2Operations,
|
||||||
ServiceConfig.AUTOMATIC_NETWORK_RETRY);
|
ServiceConfig.AUTOMATIC_NETWORK_RETRY);
|
||||||
accountManager.setAccountAttributes(account.getAccountAttributes(null));
|
accountManager.setAccountAttributes(account.getAccountAttributes(null));
|
||||||
account.setRegistered(true);
|
account.setRegistered(true);
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class SignalDependencies {
|
||||||
|
|
||||||
private ClientZkProfileOperations getClientZkProfileOperations() {
|
private ClientZkProfileOperations getClientZkProfileOperations() {
|
||||||
final var clientZkOperations = getClientZkOperations();
|
final var clientZkOperations = getClientZkOperations();
|
||||||
return clientZkOperations == null ? null : clientZkOperations.getProfileOperations();
|
return clientZkOperations.getProfileOperations();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SignalWebSocket getSignalWebSocket() {
|
public SignalWebSocket getSignalWebSocket() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue