mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Use unauth WebSocket after quick restore for transfer mode decision.
This commit is contained in:
committed by
Michelle Tang
parent
143b2b5bd5
commit
ac36eeb84d
@@ -21,7 +21,7 @@ import kotlin.time.Duration.Companion.seconds
|
||||
/**
|
||||
* Linked and new device provisioning endpoints.
|
||||
*/
|
||||
class ProvisioningApi(private val authWebSocket: SignalWebSocket.AuthenticatedWebSocket) {
|
||||
class ProvisioningApi(private val authWebSocket: SignalWebSocket.AuthenticatedWebSocket, private val unauthWebSocket: SignalWebSocket.UnauthenticatedWebSocket) {
|
||||
|
||||
/**
|
||||
* Encrypts and sends the [registrationProvisionMessage] from the current primary (old device) to the new device over
|
||||
@@ -56,7 +56,7 @@ class ProvisioningApi(private val authWebSocket: SignalWebSocket.AuthenticatedWe
|
||||
val request = WebSocketRequestMessage.get("/v1/devices/restore_account/${token.urlEncode()}?timeout=$timeout")
|
||||
|
||||
return NetworkResult.fromWebSocket(NetworkResult.LongPollingWebSocketConverter(RestoreMethodBody::class)) {
|
||||
authWebSocket.request(request, timeout.seconds)
|
||||
unauthWebSocket.request(request, timeout.seconds)
|
||||
}.map {
|
||||
it.method ?: RestoreMethod.DECLINE
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user