Fix compilation issue after rebase
This commit is contained in:
parent
c8211098f3
commit
60d80ea0ba
|
@ -23,10 +23,10 @@ import im.vector.matrix.android.api.auth.data.WellKnown
|
|||
import im.vector.matrix.android.api.auth.wellknown.WellknownResult
|
||||
import im.vector.matrix.android.api.failure.Failure
|
||||
import im.vector.matrix.android.internal.di.Unauthenticated
|
||||
import im.vector.matrix.android.internal.identity.IdentityPingApi
|
||||
import im.vector.matrix.android.internal.network.RetrofitFactory
|
||||
import im.vector.matrix.android.internal.network.executeRequest
|
||||
import im.vector.matrix.android.internal.session.homeserver.CapabilitiesAPI
|
||||
import im.vector.matrix.android.internal.session.identity.IdentityAuthAPI
|
||||
import im.vector.matrix.android.internal.task.Task
|
||||
import im.vector.matrix.android.internal.util.isValidUrl
|
||||
import okhttp3.OkHttpClient
|
||||
|
@ -119,7 +119,7 @@ internal class DefaultGetWellknownTask @Inject constructor(
|
|||
|
||||
try {
|
||||
executeRequest<Unit>(null) {
|
||||
apiCall = capabilitiesAPI.getVersions()
|
||||
apiCall = capabilitiesAPI.ping()
|
||||
}
|
||||
} catch (throwable: Throwable) {
|
||||
return WellknownResult.FailError
|
||||
|
@ -153,7 +153,7 @@ internal class DefaultGetWellknownTask @Inject constructor(
|
|||
*/
|
||||
private suspend fun validateIdentityServer(identityServerBaseUrl: String): Boolean {
|
||||
val identityPingApi = retrofitFactory.create(okHttpClient, identityServerBaseUrl)
|
||||
.create(IdentityPingApi::class.java)
|
||||
.create(IdentityAuthAPI::class.java)
|
||||
|
||||
return try {
|
||||
executeRequest<Unit>(null) {
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package im.vector.matrix.android.internal.identity
|
||||
|
||||
import im.vector.matrix.android.internal.network.NetworkConstants
|
||||
import retrofit2.Call
|
||||
import retrofit2.http.GET
|
||||
|
||||
internal interface IdentityPingApi {
|
||||
|
||||
/**
|
||||
* https://matrix.org/docs/spec/client_server/r0.4.0.html#server-discovery
|
||||
* Simple ping call to check if server alive
|
||||
*
|
||||
* Ref: https://matrix.org/docs/spec/identity_service/unstable#status-check
|
||||
*
|
||||
* @return 200 in case of success
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_IDENTITY)
|
||||
fun ping(): Call<Unit>
|
||||
}
|
|
@ -28,13 +28,9 @@ internal object NetworkConstants {
|
|||
const val URI_API_MEDIA_PREFIX_PATH_R0 = "$URI_API_MEDIA_PREFIX_PATH/r0/"
|
||||
|
||||
// Identity server
|
||||
const val URI_IDENTITY_PATH = "_matrix/identity/api/v1/"
|
||||
|
||||
const val URI_IDENTITY_PREFIX_PATH = "_matrix/identity/v2"
|
||||
const val URI_IDENTITY_PATH_V2 = "$URI_IDENTITY_PREFIX_PATH/"
|
||||
|
||||
const val URI_API_PREFIX_IDENTITY = "_matrix/identity/api/v1"
|
||||
|
||||
// TODO Ganfra, use correct value
|
||||
const val URI_INTEGRATION_MANAGER_PATH = "TODO/"
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import im.vector.matrix.android.api.session.Session
|
|||
import im.vector.riotx.R
|
||||
import im.vector.riotx.core.di.ScreenComponent
|
||||
import im.vector.riotx.core.extensions.hideKeyboard
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import kotlinx.android.synthetic.main.activity.*
|
||||
import javax.inject.Inject
|
||||
|
||||
|
@ -108,15 +107,4 @@ abstract class SimpleFragmentActivity : VectorBaseActivity() {
|
|||
}
|
||||
super.onBackPressed()
|
||||
}
|
||||
|
||||
protected fun <T : VectorViewEvents> VectorViewModel<*, *, T>.observeViewEvents(observer: (T) -> Unit) {
|
||||
viewEvents
|
||||
.observe()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
hideWaitingView()
|
||||
observer(it)
|
||||
}
|
||||
.disposeOnDestroy()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,6 +101,7 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
|
|||
.observe()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
hideWaitingView()
|
||||
observer(it)
|
||||
}
|
||||
.disposeOnDestroy()
|
||||
|
|
Loading…
Reference in New Issue