mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-14 23:18:43 +00:00
Add basic re-reg support to regV5.
This commit is contained in:
@@ -289,6 +289,9 @@ class RealNetworkController(
|
||||
fcmToken: String?,
|
||||
skipDeviceTransfer: Boolean
|
||||
): RegistrationNetworkResult<RegisterAccountResponse, RegisterAccountError> = withContext(Dispatchers.IO) {
|
||||
check(sessionId != null || recoveryPassword != null) { "Either sessionId or recoveryPassword must be provided" }
|
||||
check(sessionId == null || recoveryPassword == null) { "Either sessionId or recoveryPassword must be provided, but not both" }
|
||||
|
||||
try {
|
||||
val serviceAttributes = attributes.toServiceAccountAttributes()
|
||||
val serviceAciPreKeys = aciPreKeys.toServicePreKeyCollection()
|
||||
|
||||
@@ -178,7 +178,7 @@ class PinSettingsViewModel(
|
||||
),
|
||||
name = null,
|
||||
pniRegistrationId = RegistrationPreferences.pniRegistrationId,
|
||||
recoveryPassword = null
|
||||
recoveryPassword = RegistrationPreferences.masterKey?.deriveRegistrationRecoveryPassword()
|
||||
)
|
||||
|
||||
when (val result = networkController.setAccountAttributes(attributes)) {
|
||||
|
||||
Reference in New Issue
Block a user