mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 12:08:34 +00:00
Wire in time remaining for registration lock responses.
This commit is contained in:
@@ -430,6 +430,7 @@ class ChangeNumberViewModel : ViewModel() {
|
||||
is VerificationCodeRequestResult.RegistrationLocked ->
|
||||
store.update {
|
||||
it.copy(
|
||||
lockedTimeRemaining = result.timeRemaining,
|
||||
svr2Credentials = result.svr2Credentials,
|
||||
svr3Credentials = result.svr3Credentials
|
||||
)
|
||||
|
||||
@@ -513,7 +513,12 @@ class RegistrationViewModel : ViewModel() {
|
||||
|
||||
is TokenNotAccepted -> Log.i(TAG, "Received TokenNotAccepted.", sessionResult.getCause())
|
||||
|
||||
is RegistrationLocked -> Log.i(TAG, "Received RegistrationLocked.", sessionResult.getCause())
|
||||
is RegistrationLocked -> {
|
||||
store.update {
|
||||
it.copy(lockedTimeRemaining = sessionResult.timeRemaining)
|
||||
}
|
||||
Log.i(TAG, "Received RegistrationLocked.", sessionResult.getCause())
|
||||
}
|
||||
|
||||
is NoSuchSession -> Log.i(TAG, "Received NoSuchSession.", sessionResult.getCause())
|
||||
|
||||
@@ -763,6 +768,10 @@ class RegistrationViewModel : ViewModel() {
|
||||
|
||||
if (result is RegisterAccountResult.RegistrationLocked) {
|
||||
Log.d(TAG, "Registration lock response received.")
|
||||
val timeRemaining = result.timeRemaining
|
||||
store.update {
|
||||
it.copy(lockedTimeRemaining = timeRemaining)
|
||||
}
|
||||
reglock = true
|
||||
if (pin == null && SignalStore.svr.registrationLockToken != null) {
|
||||
Log.d(TAG, "Retrying registration with stored credentials.")
|
||||
|
||||
Reference in New Issue
Block a user