mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 04:28:35 +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 ->
|
is VerificationCodeRequestResult.RegistrationLocked ->
|
||||||
store.update {
|
store.update {
|
||||||
it.copy(
|
it.copy(
|
||||||
|
lockedTimeRemaining = result.timeRemaining,
|
||||||
svr2Credentials = result.svr2Credentials,
|
svr2Credentials = result.svr2Credentials,
|
||||||
svr3Credentials = result.svr3Credentials
|
svr3Credentials = result.svr3Credentials
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -513,7 +513,12 @@ class RegistrationViewModel : ViewModel() {
|
|||||||
|
|
||||||
is TokenNotAccepted -> Log.i(TAG, "Received TokenNotAccepted.", sessionResult.getCause())
|
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())
|
is NoSuchSession -> Log.i(TAG, "Received NoSuchSession.", sessionResult.getCause())
|
||||||
|
|
||||||
@@ -763,6 +768,10 @@ class RegistrationViewModel : ViewModel() {
|
|||||||
|
|
||||||
if (result is RegisterAccountResult.RegistrationLocked) {
|
if (result is RegisterAccountResult.RegistrationLocked) {
|
||||||
Log.d(TAG, "Registration lock response received.")
|
Log.d(TAG, "Registration lock response received.")
|
||||||
|
val timeRemaining = result.timeRemaining
|
||||||
|
store.update {
|
||||||
|
it.copy(lockedTimeRemaining = timeRemaining)
|
||||||
|
}
|
||||||
reglock = true
|
reglock = true
|
||||||
if (pin == null && SignalStore.svr.registrationLockToken != null) {
|
if (pin == null && SignalStore.svr.registrationLockToken != null) {
|
||||||
Log.d(TAG, "Retrying registration with stored credentials.")
|
Log.d(TAG, "Retrying registration with stored credentials.")
|
||||||
|
|||||||
Reference in New Issue
Block a user