mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-08 16:18:53 +01:00
Do not serialize "soft_logout"
This commit is contained in:
parent
e108534a2a
commit
e1e4b03532
@ -41,7 +41,7 @@ data class MatrixError(
|
|||||||
// For M_LIMIT_EXCEEDED
|
// For M_LIMIT_EXCEEDED
|
||||||
@Json(name = "retry_after_ms") val retryAfterMillis: Long? = null,
|
@Json(name = "retry_after_ms") val retryAfterMillis: Long? = null,
|
||||||
// For M_UNKNOWN_TOKEN
|
// For M_UNKNOWN_TOKEN
|
||||||
@Json(name = "soft_logout") val isSoftLogout: Boolean = false,
|
@Json(name = "soft_logout") val isSoftLogout: Boolean? = null,
|
||||||
// For M_INVALID_PEPPER
|
// For M_INVALID_PEPPER
|
||||||
// {"error": "pepper does not match 'erZvr'", "lookup_pepper": "pQgMS", "algorithm": "sha256", "errcode": "M_INVALID_PEPPER"}
|
// {"error": "pepper does not match 'erZvr'", "lookup_pepper": "pQgMS", "algorithm": "sha256", "errcode": "M_INVALID_PEPPER"}
|
||||||
@Json(name = "lookup_pepper") val newLookupPepper: String? = null,
|
@Json(name = "lookup_pepper") val newLookupPepper: String? = null,
|
||||||
|
@ -25,6 +25,7 @@ import org.matrix.android.sdk.api.failure.MatrixError
|
|||||||
import org.matrix.android.sdk.internal.di.MoshiProvider
|
import org.matrix.android.sdk.internal.di.MoshiProvider
|
||||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||||
import okhttp3.ResponseBody
|
import okhttp3.ResponseBody
|
||||||
|
import org.matrix.android.sdk.api.extensions.orFalse
|
||||||
import retrofit2.HttpException
|
import retrofit2.HttpException
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
@ -91,7 +92,7 @@ private fun toFailure(errorBody: ResponseBody?, httpCode: Int, globalErrorReceiv
|
|||||||
} else if (httpCode == HttpURLConnection.HTTP_UNAUTHORIZED /* 401 */
|
} else if (httpCode == HttpURLConnection.HTTP_UNAUTHORIZED /* 401 */
|
||||||
&& matrixError.code == MatrixError.M_UNKNOWN_TOKEN) {
|
&& matrixError.code == MatrixError.M_UNKNOWN_TOKEN) {
|
||||||
// Also send this error to the globalErrorReceiver, for a global management
|
// Also send this error to the globalErrorReceiver, for a global management
|
||||||
globalErrorReceiver?.handleGlobalError(GlobalError.InvalidToken(matrixError.isSoftLogout))
|
globalErrorReceiver?.handleGlobalError(GlobalError.InvalidToken(matrixError.isSoftLogout.orFalse()))
|
||||||
}
|
}
|
||||||
|
|
||||||
return Failure.ServerError(matrixError, httpCode)
|
return Failure.ServerError(matrixError, httpCode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user