import org.asamk.signal.manager.config.ServiceEnvironmentConfig;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.accounts.AccountsStore;
-import org.asamk.signal.manager.storage.identities.TrustNewIdentity;
import org.asamk.signal.manager.util.KeyUtils;
import org.signal.libsignal.protocol.IdentityKeyPair;
import org.signal.libsignal.protocol.util.KeyHelper;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;
+import static org.asamk.signal.manager.config.ServiceConfig.getCapabilities;
+
class ProvisioningManagerImpl implements ProvisioningManager {
private final static Logger logger = LoggerFactory.getLogger(ProvisioningManagerImpl.class);
logger.debug("Finishing new device registration");
var deviceId = accountManager.finishNewDeviceRegistration(ret.getProvisioningCode(),
- new ConfirmCodeMessage(false, true, registrationId, pniRegistrationId, encryptedDeviceName, null));
+ new ConfirmCodeMessage(false,
+ true,
+ registrationId,
+ pniRegistrationId,
+ encryptedDeviceName,
+ getCapabilities(false)));
// Create new account with the synced identity
var profileKey = ret.getProfileKey() == null ? KeyUtils.createProfileKey() : ret.getProfileKey();
registrationId,
pniRegistrationId,
profileKey,
- TrustNewIdentity.ON_FIRST_USE);
+ Settings.DEFAULT);
+ account.getConfigurationStore().setReadReceipts(ret.isReadReceipts());
ManagerImpl m = null;
try {
private boolean canRelinkExistingAccount(final String accountPath) throws IOException {
final SignalAccount signalAccount;
try {
- signalAccount = SignalAccount.load(pathConfig.dataPath(),
- accountPath,
- false,
- TrustNewIdentity.ON_FIRST_USE);
+ signalAccount = SignalAccount.load(pathConfig.dataPath(), accountPath, false, Settings.DEFAULT);
} catch (IOException e) {
logger.debug("Account in use or failed to load.", e);
return false;