Add basic re-reg support to regV5.

This commit is contained in:
Greyson Parrelli
2026-01-30 16:57:55 -05:00
parent 85408f2b12
commit 6416df241f
20 changed files with 361 additions and 69 deletions

View File

@@ -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()

View File

@@ -178,7 +178,7 @@ class PinSettingsViewModel(
),
name = null,
pniRegistrationId = RegistrationPreferences.pniRegistrationId,
recoveryPassword = null
recoveryPassword = RegistrationPreferences.masterKey?.deriveRegistrationRecoveryPassword()
)
when (val result = networkController.setAccountAttributes(attributes)) {